vcpkg/ports/pcre/fix-arm-config-define.patch

61 lines
1.8 KiB
Diff
Raw Normal View History

2017-05-25 22:09:13 +08:00
diff --git a/sljit/sljitConfigInternal.h b/sljit/sljitConfigInternal.h
index 4dc452f..5a9827d 100644
--- "a/sljit/sljitConfigInternal.h"
+++ "b/sljit/sljitConfigInternal.h"
@@ -149,7 +149,7 @@
#if defined(_M_X64) || defined(__x86_64__)
#define SLJIT_CONFIG_X86_64 1
-#elif defined(_ARM_)
+#elif defined(_M_ARM)
#define SLJIT_CONFIG_ARM_V5 1
#else
#define SLJIT_CONFIG_X86_32 1
@@ -332,9 +332,16 @@
#else
+#if defined(__linux__)
/* Calls __ARM_NR_cacheflush on ARM-Linux. */
#define SLJIT_CACHE_FLUSH(from, to) \
__clear_cache((char*)(from), (char*)(to))
+#elif(_WIN32)
+#pragma comment(lib, "kernel32.lib")
+uint32_t FlushInstructionCache(void *hProcess, void *lpBaseAddress, uintptr_t dwSize);
+#define SLJIT_CACHE_FLUSH(from, to) \
+ FlushInstructionCache(GetCurrentProcess(), (void*)(from), (uintptr_t)(to - from));
+#endif
#endif
2017-07-12 23:47:19 +08:00
diff --git a/sljit/sljitNativeARM_32.c b/sljit/sljitNativeARM_32.c
index 745da99..83942b0 100644
--- a/sljit/sljitNativeARM_32.c
+++ b/sljit/sljitNativeARM_32.c
@@ -1573,12 +1573,8 @@ static sljit_s32 emit_op(struct sljit_compiler *compiler, sljit_s32 op, sljit_s3
extern "C" {
#endif
-#if defined(__GNUC__)
2017-05-25 22:09:13 +08:00
extern unsigned int __aeabi_uidivmod(unsigned int numerator, unsigned int denominator);
extern int __aeabi_idivmod(int numerator, int denominator);
2017-07-12 23:47:19 +08:00
-#else
2017-05-25 22:09:13 +08:00
-#error "Software divmod functions are needed"
2017-07-12 23:47:19 +08:00
-#endif
2017-05-25 22:09:13 +08:00
#ifdef __cplusplus
2017-07-12 23:47:19 +08:00
}
@@ -1635,12 +1631,8 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
}
}
-#if defined(__GNUC__)
2017-05-25 22:09:13 +08:00
FAIL_IF(sljit_emit_ijump(compiler, SLJIT_FAST_CALL, SLJIT_IMM,
((op | 0x2) == SLJIT_DIV_UW ? SLJIT_FUNC_OFFSET(__aeabi_uidivmod) : SLJIT_FUNC_OFFSET(__aeabi_idivmod))));
2017-07-12 23:47:19 +08:00
-#else
2017-05-25 22:09:13 +08:00
-#error "Software divmod functions are needed"
2017-07-12 23:47:19 +08:00
-#endif
2017-05-25 22:09:13 +08:00
2017-07-12 23:47:19 +08:00
if (saved_reg_count > 0) {
if (saved_reg_count >= 3) {