| 1334 | #endif |
| 1335 | |
| 1336 | static FILE *stbi__fopen(char const *filename, char const *mode) |
| 1337 | { |
| 1338 | FILE *f; |
| 1339 | #if defined(_WIN32) && defined(STBI_WINDOWS_UTF8) |
| 1340 | wchar_t wMode[64]; |
| 1341 | wchar_t wFilename[1024]; |
| 1342 | if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, filename, -1, wFilename, sizeof(wFilename)/sizeof(*wFilename))) |
| 1343 | return 0; |
| 1344 | |
| 1345 | if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, mode, -1, wMode, sizeof(wMode)/sizeof(*wMode))) |
| 1346 | return 0; |
| 1347 | |
| 1348 | #if defined(_MSC_VER) && _MSC_VER >= 1400 |
| 1349 | if (0 != _wfopen_s(&f, wFilename, wMode)) |
| 1350 | f = 0; |
| 1351 | #else |
| 1352 | f = _wfopen(wFilename, wMode); |
| 1353 | #endif |
| 1354 | |
| 1355 | #elif defined(_MSC_VER) && _MSC_VER >= 1400 |
| 1356 | if (0 != fopen_s(&f, filename, mode)) |
| 1357 | f=0; |
| 1358 | #else |
| 1359 | f = fopen(filename, mode); |
| 1360 | #endif |
| 1361 | return f; |
| 1362 | } |
| 1363 | |
| 1364 | |
| 1365 | STBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp) |
no outgoing calls
no test coverage detected