wasm: fix compilation

After 'all: fixing clang warnings' (e7c3a91) there was a problem with wasm
compilation, as strncpy and strdup.
Disable define is __EMSCRIPTEN__.
This commit is contained in:
Michal Maciola 2021-10-08 16:55:20 +02:00 committed by Hermet Park
parent cba7cf0e2b
commit e12729e0d3
2 changed files with 2 additions and 2 deletions

View file

@ -48,7 +48,7 @@ using namespace tvg;
#define TVG_FALLTHROUGH #define TVG_FALLTHROUGH
#endif #endif
#ifdef __clang__ #if defined(__clang__) && !defined(__EMSCRIPTEN__)
#define strncpy strncpy_s #define strncpy strncpy_s
#define strdup _strdup #define strdup _strdup
#endif #endif

View file

@ -33,7 +33,7 @@
static FILE* _fopen(const char* filename, const char* mode) static FILE* _fopen(const char* filename, const char* mode)
{ {
#ifdef __clang__ #if defined(__clang__) && !defined(__EMSCRIPTEN__)
FILE *fp; FILE *fp;
auto err = fopen_s(&fp, filename, mode); auto err = fopen_s(&fp, filename, mode);
if (err != 0) return nullptr; if (err != 0) return nullptr;