all: fix compilation errors on non-windows clang
authorMichal Maciola <m.maciola@samsung.com>
Wed, 17 Nov 2021 11:00:38 +0000 (12:00 +0100)
committerJunsuChoi <jsuya.choi@samsung.com>
Fri, 19 Nov 2021 05:27:36 +0000 (14:27 +0900)
Thorvg couldn't be compiled on macos as non-portable microsoft calls used.
Changed definitions checking to Visual Studio only.

src/lib/tvgCommon.h
src/savers/tvg/tvgTvgSaver.cpp

index 14096d75b735b3d507abab0f7fc3a6e69f1c1159..3ef4915d5e27164e49f2cc2b85a2e6403e4d7139 100644 (file)
@@ -53,7 +53,7 @@ using namespace tvg;
 
 #define TVG_LOG_TAG "ThorVG"
 
-#if defined(__clang__) && !defined(__EMSCRIPTEN__)
+#if defined(_MSC_VER) && defined(__clang__)
     #define strncpy strncpy_s
     #define strdup _strdup
 #endif
index 46ad28e23e7a0de2e5a2ae4f43dcbd9eb2828298..9450d80e88fc85fead033316c3f074fc62a1789c 100644 (file)
@@ -32,7 +32,7 @@
 
 static FILE* _fopen(const char* filename, const char* mode)
 {
-#if defined(__clang__) && !defined(__EMSCRIPTEN__)
+#if defined(_MSC_VER) && defined(__clang__)
     FILE *fp;
     auto err = fopen_s(&fp, filename, mode);
     if (err != 0) return nullptr;