| 1363 | #endif |
| 1364 | |
| 1365 | static FILE* stbi__fopen(char const* filename, char const* mode) { |
| 1366 | FILE* f; |
| 1367 | #if defined(_WIN32) && defined(STBI_WINDOWS_UTF8) |
| 1368 | wchar_t wMode[64]; |
| 1369 | wchar_t wFilename[1024]; |
| 1370 | if (0 == MultiByteToWideChar( |
| 1371 | 65001 /* UTF8 */, 0, filename, -1, wFilename, |
| 1372 | sizeof(wFilename) / sizeof(*wFilename))) |
| 1373 | return 0; |
| 1374 | |
| 1375 | if (0 == |
| 1376 | MultiByteToWideChar( |
| 1377 | 65001 /* UTF8 */, 0, mode, -1, wMode, sizeof(wMode) / sizeof(*wMode))) |
| 1378 | return 0; |
| 1379 | |
| 1380 | #if defined(_MSC_VER) && _MSC_VER >= 1400 |
| 1381 | if (0 != _wfopen_s(&f, wFilename, wMode)) |
| 1382 | f = 0; |
| 1383 | #else |
| 1384 | f = _wfopen(wFilename, wMode); |
| 1385 | #endif |
| 1386 | |
| 1387 | #elif defined(_MSC_VER) && _MSC_VER >= 1400 |
| 1388 | if (0 != fopen_s(&f, filename, mode)) |
| 1389 | f = 0; |
| 1390 | #else |
| 1391 | f = fopen(filename, mode); |
| 1392 | #endif |
| 1393 | return f; |
| 1394 | } |
| 1395 | |
| 1396 | STBIDEF stbi_uc* stbi_load( |
| 1397 | char const* filename, int* x, int* y, int* comp, int req_comp) { |
no outgoing calls
no test coverage detected