aboutsummaryrefslogtreecommitdiff
path: root/ports/pcre/fix-arm-config-define.patch
blob: 94ca808c3369e896c5b39127e3b98cea36b001f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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
 
diff --git "a/sljit/sljitNativeARM_32.c" "b/sljit/sljitNativeARM_32.c"
index a756f82..86bdcbb 100644
--- "a/sljit/sljitNativeARM_32.c"
+++ "b/sljit/sljitNativeARM_32.c"
@@ -1798,7 +1798,8 @@ extern "C" {
 extern unsigned int __aeabi_uidivmod(unsigned int numerator, unsigned int denominator);
 extern int __aeabi_idivmod(int numerator, int denominator);
 #else
-#error "Software divmod functions are needed"
+extern unsigned int __aeabi_uidivmod(unsigned int numerator, unsigned int denominator);
+extern int __aeabi_idivmod(int numerator, int denominator);
 #endif
 
 #ifdef __cplusplus
@@ -1852,7 +1853,8 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
 		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))));
 #else
-#error "Software divmod functions are needed"
+		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))));
 #endif
 
 		if ((op >= SLJIT_DIV_UW) && (compiler->scratches >= 3)) {