瀏覽代碼

darwin: Write errors in choosing the pixel format to the crash log

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
tags/10.3-branchpoint
Jeremy Huddleston Sequoia 11 年之前
父節點
當前提交
9eb1d36c97
共有 1 個檔案被更改,包括 16 行新增2 行删除
  1. 16
    2
      src/glx/apple/apple_visual.c

+ 16
- 2
src/glx/apple/apple_visual.c 查看文件

MAX_ATTR = 60 MAX_ATTR = 60
}; };


static char __crashreporter_info_buff__[4096] = { 0 };
static const char *__crashreporter_info__ __attribute__((__used__)) =
&__crashreporter_info_buff__[0];
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
// This is actually a toolchain requirement, but I'm not sure the correct check,
// but it should be fine to just only include it for Leopard and later. This line
// just tells the linker to never strip this symbol (such as for space optimization)
__asm__ (".desc ___crashreporter_info__, 0x10");
#endif

void void
apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * mode, apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * mode,
bool * double_buffered, bool * uses_stereo, bool * double_buffered, bool * uses_stereo,
error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref); error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref);


if (error) { if (error) {
fprintf(stderr, "error: %s\n", apple_cgl.error_string(error));
snprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__),
"CGLChoosePixelFormat error: %s\n", apple_cgl.error_string(error));
fprintf(stderr, "%s", __crashreporter_info_buff__);
abort(); abort();
} }


if (!*pfobj) { if (!*pfobj) {
fprintf(stderr, "No matching pixelformats found, perhaps try using LIBGL_ALLOW_SOFTWARE\n");
snprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__),
"No matching pixelformats found, perhaps try using LIBGL_ALLOW_SOFTWARE\n");
fprintf(stderr, "%s", __crashreporter_info_buff__);
abort(); abort();
} }
} }

Loading…
取消
儲存