Переглянути джерело

Fix Legacy-Link and NDK-Compile errors

Fixes #2317
Oguz Bastemur 9 роки тому
батько
коміт
45284fc840

+ 4 - 0
lib/Backend/Backend.cpp

@@ -3,3 +3,7 @@
 // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
 // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
 //-------------------------------------------------------------------------------------------------------
 //-------------------------------------------------------------------------------------------------------
 #include "Backend.h"
 #include "Backend.h"
+
+#if !ENABLE_OOP_NATIVE_CODEGEN
+JITManager JITManager::s_jitManager; // dummy object when OOP JIT disabled
+#endif

+ 1 - 1
lib/Jsrt/JsrtHelper.cpp

@@ -5,7 +5,7 @@
 
 
 #include "JsrtPch.h"
 #include "JsrtPch.h"
 
 
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__ANDROID__)
 #include <pthread.h>
 #include <pthread.h>
 #endif
 #endif
 
 

+ 4 - 0
lib/Jsrt/JsrtPch.h

@@ -4,5 +4,9 @@
 //-------------------------------------------------------------------------------------------------------
 //-------------------------------------------------------------------------------------------------------
 #pragma once
 #pragma once
 
 
+#if defined(__ANDROID__)
+#include <pthread.h>
+#endif
+
 #include "Runtime.h"
 #include "Runtime.h"
 #include "JsrtContext.h"
 #include "JsrtContext.h"

+ 0 - 4
lib/Runtime/Library/RuntimeLibraryPch.cpp

@@ -3,7 +3,3 @@
 // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
 // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
 //-------------------------------------------------------------------------------------------------------
 //-------------------------------------------------------------------------------------------------------
 #include "RuntimeLibraryPch.h"
 #include "RuntimeLibraryPch.h"
-
-#if !ENABLE_OOP_NATIVE_CODEGEN
-JITManager JITManager::s_jitManager; // dummy object when OOP JIT disabled
-#endif

+ 1 - 0
pal/src/CMakeLists.txt

@@ -100,6 +100,7 @@ set(SOURCES
   cruntime/thread.cpp
   cruntime/thread.cpp
   cruntime/wchar.cpp
   cruntime/wchar.cpp
   cruntime/wchartls.cpp
   cruntime/wchartls.cpp
+  cruntime/runtime_proxy.cpp
   safecrt/makepath_s.c
   safecrt/makepath_s.c
   safecrt/mbusafecrt.c
   safecrt/mbusafecrt.c
   safecrt/safecrt_input_s.c
   safecrt/safecrt_input_s.c

+ 25 - 0
pal/src/cruntime/runtime_proxy.cpp

@@ -0,0 +1,25 @@
+//
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+// do not use other PAL headers here.
+// combining wctype.h with PAL headers creates type mismatches under latest NDK
+
+#if HAVE_COREFOUNDATION
+#define CF_EXCLUDE_CSTD_HEADERS
+#include <CoreFoundation/CoreFoundation.h>
+#include <wctype.h>
+#else
+#include <wctype.h>
+#endif
+
+int proxy_iswprint(char16_t c)
+{
+    return iswprint(c);
+}
+
+int proxy_iswspace(char16_t c)
+{
+    return iswspace(c);
+}

+ 12 - 0
pal/src/cruntime/runtime_proxy.h

@@ -0,0 +1,12 @@
+//
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+#ifndef PAL_SRC_CRUNTIME_RUNTIME_PROXY_H
+#define PAL_SRC_CRUNTIME_RUNTIME_PROXY_H
+
+int proxy_iswprint(char16_t c);
+int proxy_iswspace(char16_t c);
+
+#endif // PAL_SRC_CRUNTIME_RUNTIME_PROXY_H

+ 3 - 10
pal/src/cruntime/wchar.cpp

@@ -33,14 +33,7 @@ Abstract:
 #include "config.h"
 #include "config.h"
 #endif
 #endif
 
 
-#if HAVE_COREFOUNDATION
-#define CF_EXCLUDE_CSTD_HEADERS
-#include <CoreFoundation/CoreFoundation.h>
-#include <wctype.h>
-#else
-#include <wctype.h>
-#endif
-
+#include "runtime_proxy.h"
 #include <errno.h>
 #include <errno.h>
 
 
 SET_DEFAULT_DEBUG_CHANNEL(CRT);
 SET_DEFAULT_DEBUG_CHANNEL(CRT);
@@ -306,7 +299,7 @@ PAL_iswspace(char16_t c)
     PERF_ENTRY(iswspace);
     PERF_ENTRY(iswspace);
     ENTRY("PAL_iswspace (c=%C)\n", c);
     ENTRY("PAL_iswspace (c=%C)\n", c);
 
 
-    ret = iswspace(c);
+    ret = proxy_iswspace(c);
 
 
     LOGEXIT("PAL_iswspace returns int %d\n", ret);
     LOGEXIT("PAL_iswspace returns int %d\n", ret);
     PERF_EXIT(iswspace);
     PERF_EXIT(iswspace);
@@ -1900,7 +1893,7 @@ PAL_iswprint( char16_t c )
     PERF_ENTRY(iswprint);
     PERF_ENTRY(iswprint);
     ENTRY("PAL_iswprint (%#X)\n", c);
     ENTRY("PAL_iswprint (%#X)\n", c);
 
 
-    ret = iswprint(c);
+    ret = proxy_iswprint(c);
 
 
     LOGEXIT("PAL_iswprint returns %d\n", ret);
     LOGEXIT("PAL_iswprint returns %d\n", ret);
     PERF_EXIT(iswprint);
     PERF_EXIT(iswprint);