isomorfeus-ferret 0.12.4 → 0.12.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +612 -612
  3. data/README.md +80 -48
  4. data/ext/isomorfeus_ferret_ext/bm_hash.c +9 -6
  5. data/ext/isomorfeus_ferret_ext/bm_micro_string.c +4 -2
  6. data/ext/isomorfeus_ferret_ext/frb_store.c +34 -5
  7. data/ext/isomorfeus_ferret_ext/frt_posh.h +11 -19
  8. data/ext/isomorfeus_ferret_ext/frt_q_parser.c +1844 -1911
  9. data/ext/isomorfeus_ferret_ext/frt_q_phrase.c +7 -7
  10. data/ext/isomorfeus_ferret_ext/frt_scanner.c +1 -0
  11. data/ext/isomorfeus_ferret_ext/frt_scanner_mb.c +1 -0
  12. data/ext/isomorfeus_ferret_ext/frt_scanner_utf8.c +1 -0
  13. data/ext/isomorfeus_ferret_ext/frt_search.h +1 -1
  14. data/ext/isomorfeus_ferret_ext/libstemmer.c +14 -11
  15. data/ext/isomorfeus_ferret_ext/libstemmer.h +4 -9
  16. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_basque.c +1167 -0
  17. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_basque.h +6 -0
  18. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_catalan.c +1433 -0
  19. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_catalan.h +6 -0
  20. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_danish.c +120 -143
  21. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_danish.h +1 -2
  22. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_dutch.c +217 -237
  23. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_dutch.h +1 -1
  24. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_english.c +377 -432
  25. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_english.h +1 -1
  26. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_finnish.c +298 -342
  27. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_finnish.h +1 -2
  28. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_french.c +530 -524
  29. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_french.h +1 -1
  30. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_german.c +201 -214
  31. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_german.h +1 -1
  32. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_hungarian.c +1 -1
  33. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_indonesian.c +394 -0
  34. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_indonesian.h +6 -0
  35. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_irish.c +457 -0
  36. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_irish.h +6 -0
  37. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_italian.c +396 -439
  38. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_italian.h +1 -1
  39. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_norwegian.c +104 -128
  40. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_norwegian.h +1 -1
  41. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_porter.c +242 -273
  42. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_porter.h +1 -1
  43. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_portuguese.c +406 -461
  44. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_portuguese.h +1 -2
  45. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_spanish.c +405 -456
  46. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_spanish.h +1 -1
  47. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_swedish.c +108 -126
  48. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_swedish.h +1 -1
  49. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_hungarian.c +849 -0
  50. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_hungarian.h +6 -0
  51. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_romanian.c +373 -405
  52. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_romanian.h +1 -1
  53. data/ext/isomorfeus_ferret_ext/stem_KOI8_R_russian.c +288 -305
  54. data/ext/isomorfeus_ferret_ext/stem_KOI8_R_russian.h +1 -1
  55. data/ext/isomorfeus_ferret_ext/stem_UTF_8_arabic.c +1651 -0
  56. data/ext/isomorfeus_ferret_ext/stem_UTF_8_arabic.h +6 -0
  57. data/ext/isomorfeus_ferret_ext/stem_UTF_8_armenian.c +546 -0
  58. data/ext/isomorfeus_ferret_ext/stem_UTF_8_armenian.h +6 -0
  59. data/ext/isomorfeus_ferret_ext/stem_UTF_8_basque.c +1171 -0
  60. data/ext/isomorfeus_ferret_ext/stem_UTF_8_basque.h +6 -0
  61. data/ext/isomorfeus_ferret_ext/stem_UTF_8_catalan.c +1436 -0
  62. data/ext/isomorfeus_ferret_ext/stem_UTF_8_catalan.h +6 -0
  63. data/ext/isomorfeus_ferret_ext/stem_UTF_8_danish.c +121 -141
  64. data/ext/isomorfeus_ferret_ext/stem_UTF_8_danish.h +1 -1
  65. data/ext/isomorfeus_ferret_ext/stem_UTF_8_dutch.c +221 -241
  66. data/ext/isomorfeus_ferret_ext/stem_UTF_8_dutch.h +1 -1
  67. data/ext/isomorfeus_ferret_ext/stem_UTF_8_english.c +381 -431
  68. data/ext/isomorfeus_ferret_ext/stem_UTF_8_english.h +1 -1
  69. data/ext/isomorfeus_ferret_ext/stem_UTF_8_finnish.c +300 -345
  70. data/ext/isomorfeus_ferret_ext/stem_UTF_8_finnish.h +1 -1
  71. data/ext/isomorfeus_ferret_ext/stem_UTF_8_french.c +518 -511
  72. data/ext/isomorfeus_ferret_ext/stem_UTF_8_french.h +1 -1
  73. data/ext/isomorfeus_ferret_ext/stem_UTF_8_german.c +201 -209
  74. data/ext/isomorfeus_ferret_ext/stem_UTF_8_german.h +1 -1
  75. data/ext/isomorfeus_ferret_ext/stem_UTF_8_greek.c +3660 -0
  76. data/ext/isomorfeus_ferret_ext/stem_UTF_8_greek.h +6 -0
  77. data/ext/isomorfeus_ferret_ext/stem_UTF_8_hindi.c +309 -0
  78. data/ext/isomorfeus_ferret_ext/stem_UTF_8_hindi.h +6 -0
  79. data/ext/isomorfeus_ferret_ext/stem_UTF_8_hungarian.c +306 -671
  80. data/ext/isomorfeus_ferret_ext/stem_UTF_8_hungarian.h +1 -1
  81. data/ext/isomorfeus_ferret_ext/stem_UTF_8_indonesian.c +394 -0
  82. data/ext/isomorfeus_ferret_ext/stem_UTF_8_indonesian.h +6 -0
  83. data/ext/isomorfeus_ferret_ext/stem_UTF_8_irish.c +457 -0
  84. data/ext/isomorfeus_ferret_ext/stem_UTF_8_irish.h +6 -0
  85. data/ext/isomorfeus_ferret_ext/stem_UTF_8_italian.c +400 -442
  86. data/ext/isomorfeus_ferret_ext/stem_UTF_8_italian.h +1 -1
  87. data/ext/isomorfeus_ferret_ext/stem_UTF_8_lithuanian.c +824 -0
  88. data/ext/isomorfeus_ferret_ext/stem_UTF_8_lithuanian.h +6 -0
  89. data/ext/isomorfeus_ferret_ext/stem_UTF_8_nepali.c +408 -0
  90. data/ext/isomorfeus_ferret_ext/stem_UTF_8_nepali.h +6 -0
  91. data/ext/isomorfeus_ferret_ext/stem_UTF_8_norwegian.c +105 -127
  92. data/ext/isomorfeus_ferret_ext/stem_UTF_8_norwegian.h +1 -1
  93. data/ext/isomorfeus_ferret_ext/stem_UTF_8_porter.c +245 -276
  94. data/ext/isomorfeus_ferret_ext/stem_UTF_8_porter.h +1 -1
  95. data/ext/isomorfeus_ferret_ext/stem_UTF_8_portuguese.c +409 -464
  96. data/ext/isomorfeus_ferret_ext/stem_UTF_8_portuguese.h +1 -1
  97. data/ext/isomorfeus_ferret_ext/stem_UTF_8_romanian.c +376 -408
  98. data/ext/isomorfeus_ferret_ext/stem_UTF_8_romanian.h +1 -1
  99. data/ext/isomorfeus_ferret_ext/stem_UTF_8_russian.c +272 -287
  100. data/ext/isomorfeus_ferret_ext/stem_UTF_8_russian.h +1 -1
  101. data/ext/isomorfeus_ferret_ext/stem_UTF_8_serbian.c +6530 -0
  102. data/ext/isomorfeus_ferret_ext/stem_UTF_8_serbian.h +6 -0
  103. data/ext/isomorfeus_ferret_ext/stem_UTF_8_spanish.c +407 -458
  104. data/ext/isomorfeus_ferret_ext/stem_UTF_8_spanish.h +1 -1
  105. data/ext/isomorfeus_ferret_ext/stem_UTF_8_swedish.c +110 -125
  106. data/ext/isomorfeus_ferret_ext/stem_UTF_8_swedish.h +1 -1
  107. data/ext/isomorfeus_ferret_ext/stem_UTF_8_tamil.c +1865 -0
  108. data/ext/isomorfeus_ferret_ext/stem_UTF_8_tamil.h +6 -0
  109. data/ext/isomorfeus_ferret_ext/stem_UTF_8_turkish.c +698 -806
  110. data/ext/isomorfeus_ferret_ext/stem_UTF_8_turkish.h +1 -1
  111. data/ext/isomorfeus_ferret_ext/stem_UTF_8_yiddish.c +1220 -0
  112. data/ext/isomorfeus_ferret_ext/stem_UTF_8_yiddish.h +6 -0
  113. data/ext/isomorfeus_ferret_ext/stem_api.c +1 -9
  114. data/ext/isomorfeus_ferret_ext/stem_api.h +1 -3
  115. data/ext/isomorfeus_ferret_ext/stem_header.h +30 -26
  116. data/ext/isomorfeus_ferret_ext/stem_modules.h +113 -26
  117. data/ext/isomorfeus_ferret_ext/stem_modules.txt +18 -5
  118. data/ext/isomorfeus_ferret_ext/stem_utilities.c +167 -132
  119. data/ext/isomorfeus_ferret_ext/test.c +7 -1
  120. data/ext/isomorfeus_ferret_ext/test_search.c +0 -1
  121. data/lib/isomorfeus/ferret/version.rb +1 -1
  122. metadata +39 -4
  123. data/ext/isomorfeus_ferret_ext/q_parser.y +0 -1366
data/README.md CHANGED
@@ -1,48 +1,80 @@
1
- <h1 align="center">
2
- <img src="https://github.com/isomorfeus/isomorfeus-ferret/blob/master/Logo.png?raw=true" align="center" width="216" height="234" />
3
- <br/>
4
- &nbsp;&nbsp;&nbsp;Isomorfeus Ferret<br/>
5
- </h1>
6
-
7
- Convenient and well performing document store, indexing and search.
8
-
9
- ### Community and Support
10
- At the [Isomorfeus Framework Project](http://isomorfeus.com)
11
-
12
- ## About this project
13
-
14
- Isomorfeus-Ferret is a revived version of the original ferret gem created by Dave Balmain.
15
- During revival many things havbe been fixed, now all tests pass, no crashes and it
16
- successfully compiles and runs with rubys >3. Its no longer a goal to have
17
- a c library available, but instead the usage is meant as ruby gem with a c extension only.
18
-
19
- It should work on *nixes and *nuxes and also works on Windows.
20
-
21
- However, the revival is still fresh and although it appears to be working, issues have to be expected.
22
-
23
-
24
- ## Documentation
25
-
26
- The documentations is currently scattered throughout the repo.
27
-
28
- For a quick start its best to read:
29
- https://github.com/isomorfeus/isomorfeus-ferret/blob/master/TUTORIAL.md
30
-
31
- Further:
32
- https://github.com/isomorfeus/isomorfeus-ferret/blob/master/lib/isomorfeus/ferret/index/index.rb
33
- https://github.com/isomorfeus/isomorfeus-ferret/blob/master/lib/isomorfeus/ferret/document.rb
34
-
35
- The query language and parser are documented here:
36
- https://github.com/isomorfeus/isomorfeus-ferret/blob/master/ext/isomorfeus_ferret_ext/frb_qparser.c
37
-
38
- Examples can be found in the 'test' directory or in 'misc/ferret_vs_lucene'.
39
- ## Future
40
-
41
- Lots of things to do:
42
- - Bring documentation in order in a docs directory
43
- - Review code (especially for memory/stack issues, typical c issues)
44
- - Take care of ruby GVL and threading
45
- - Check locking (thread and filesystem)
46
- - See todo directory: https://github.com/isomorfeus/isomorfeus-ferret/tree/master/misc/todo
47
-
48
- Any help, support much appreciated!
1
+ <h1 align="center">
2
+ <img src="https://github.com/isomorfeus/isomorfeus-ferret/blob/master/Logo.png?raw=true" align="center" width="216" height="234" />
3
+ <br/>
4
+ &nbsp;&nbsp;&nbsp;Isomorfeus Ferret<br/>
5
+ </h1>
6
+
7
+ Convenient and well performing document store, indexing and search.
8
+
9
+ ### Community and Support
10
+ At the [Isomorfeus Framework Project](https://isomorfeus.com)
11
+
12
+ ## About this project
13
+
14
+ Isomorfeus-Ferret is a revived version of the original ferret gem created by Dave Balmain.
15
+ During revival many things havbe been fixed, now all tests pass, no crashes and it
16
+ successfully compiles and runs with rubys >3. Its no longer a goal to have
17
+ a c library available, but instead the usage is meant as ruby gem with a c extension only.
18
+
19
+ It should work on *nixes and *nuxes and also works on Windows.
20
+
21
+ However, the revival is still fresh and although it appears to be working, issues have to be expected.
22
+
23
+ ## Documentation
24
+
25
+ The documentations is currently scattered throughout the repo.
26
+
27
+ For a quick start its best to read:
28
+ https://github.com/isomorfeus/isomorfeus-ferret/blob/master/TUTORIAL.md
29
+
30
+ Further:
31
+ https://github.com/isomorfeus/isomorfeus-ferret/blob/master/lib/isomorfeus/ferret/index/index.rb
32
+ https://github.com/isomorfeus/isomorfeus-ferret/blob/master/lib/isomorfeus/ferret/document.rb
33
+
34
+ The query language and parser are documented here:
35
+ https://github.com/isomorfeus/isomorfeus-ferret/blob/master/ext/isomorfeus_ferret_ext/frb_qparser.c
36
+
37
+ Examples can be found in the 'test' directory or in 'misc/ferret_vs_lucene'.
38
+
39
+ ## Running Specs
40
+
41
+ - clone repo
42
+ - bundle install
43
+ - rake units
44
+ - rake thread_safety
45
+
46
+ Ensure your locale is set to C.UTF-8, because the internal c tests don't know how to handle localized output.
47
+
48
+ ## Benchmarks
49
+
50
+ - clone repo
51
+ - bundle install
52
+ - rake ferret_vs_lucene
53
+
54
+ A recent Java JDK must be installed to compile and run lucene benchmarks.
55
+
56
+ Results on Linux:
57
+ ```
58
+ Ferret:
59
+ Indexing Secs: 7.36 Docs: 19043, 2587 docs/s
60
+ Searching took: 0.3366296s for 8000 queries
61
+ thats 23765 q/s
62
+
63
+ Lucene:
64
+ Indexing Secs: 4.22 Docs: 19043, 4516 docs/s
65
+ Searching took: 1.48s for 8000 queries
66
+ thats 5420 q/s
67
+ ---------------------------------------------------
68
+ Lucene 9.0.0 0b18b3b965cedaf5eb129aa41243a44c83ca826d - jpountz - 2021-12-01 14:23:49
69
+ JVM 17.0.1 (Private Build)
70
+ ```
71
+
72
+ ## Future
73
+
74
+ Lots of things to do:
75
+ - Bring documentation in order in a docs directory
76
+ - Review code (especially for memory/stack issues, typical c issues)
77
+ - Take care of ruby GVL and threading
78
+ - See todo directory: https://github.com/isomorfeus/isomorfeus-ferret/tree/master/misc/todo
79
+
80
+ Any help, support much appreciated!
@@ -7,20 +7,21 @@
7
7
  static void ferret_hash()
8
8
  {
9
9
  int i;
10
+ void *res = NULL;
10
11
  for (i = 0; i < N; i++) {
11
12
  FrtHash *h = frt_h_new_str(NULL, NULL);
12
13
  const char **word;
13
14
  char buf[100];
14
- long res;
15
15
  for (word = WORD_LIST; *word; word++) {
16
16
  frt_h_set(h, *word, (void *)1);
17
17
  }
18
18
  for (word = WORD_LIST; *word; word++) {
19
19
  strcpy(buf, *word);
20
- res = (long)frt_h_get(h, buf);
20
+ res = frt_h_get(h, buf);
21
21
  }
22
22
  frt_h_destroy(h);
23
23
  }
24
+ (void)res;
24
25
  }
25
26
 
26
27
  BENCH(hash_implementations)
@@ -31,18 +32,19 @@ BENCH(hash_implementations)
31
32
  static void standard_hash()
32
33
  {
33
34
  int i;
35
+ void *res = NULL;
34
36
  for (i = 0; i < N; i++) {
35
37
  FrtHash *h = frt_h_new_str(NULL, NULL);
36
38
  const char **word;
37
39
  char buf[100];
38
- long res;
39
40
  for (word = WORD_LIST; *word; word++) {
40
41
  frt_h_set(h, *word, (void *)1);
41
42
  strcpy(buf, *word);
42
- res = (long)frt_h_get(h, buf);
43
+ res = frt_h_get(h, buf);
43
44
  }
44
45
  frt_h_destroy(h);
45
46
  }
47
+ (void)res;
46
48
  }
47
49
 
48
50
  #define PERTURB_SHIFT 5
@@ -96,19 +98,20 @@ static FrtHashEntry *h_lookup_str(FrtHash *ht, register const void *key)
96
98
  static void string_hash()
97
99
  {
98
100
  int i;
101
+ void *res = NULL;
99
102
  for (i = 0; i < N; i++) {
100
103
  FrtHash *h = frt_h_new_str(NULL, NULL);
101
104
  const char **word;
102
105
  char buf[100];
103
- long res;
104
106
  h->lookup_i = &h_lookup_str;
105
107
  for (word = WORD_LIST; *word; word++) {
106
108
  frt_h_set(h, *word, (void *)1);
107
109
  strcpy(buf, *word);
108
- res = (long)frt_h_get(h, buf);
110
+ res = frt_h_get(h, buf);
109
111
  }
110
112
  frt_h_destroy(h);
111
113
  }
114
+ (void)res;
112
115
  }
113
116
 
114
117
  BENCH(specialized_string_hash)
@@ -5,7 +5,7 @@
5
5
 
6
6
  static void do_strcmp()
7
7
  {
8
- char **word;
8
+ const char **word;
9
9
  char buf[100];
10
10
  int res, i;
11
11
 
@@ -15,11 +15,12 @@ static void do_strcmp()
15
15
  memcpy(buf, *word, len+1);
16
16
  res = strcmp(buf, *word);
17
17
  }
18
+ (void)res;
18
19
  }
19
20
 
20
21
  static void do_strncmp()
21
22
  {
22
- char **word;
23
+ const char **word;
23
24
  char buf[100];
24
25
  int res, i;
25
26
 
@@ -29,6 +30,7 @@ static void do_strncmp()
29
30
  memcpy(buf, *word, len+1);
30
31
  res = strncmp(buf, *word, len + 1);
31
32
  }
33
+ (void)res;
32
34
  }
33
35
 
34
36
  BENCH(strcmp_when_length_is_known)
@@ -1,5 +1,6 @@
1
1
  #include "frt_store.h"
2
2
  #include "isomorfeus_ferret.h"
3
+ #include <time.h>
3
4
 
4
5
  static ID id_ref_cnt;
5
6
  VALUE cLock;
@@ -70,13 +71,26 @@ frb_lock_obtain(int argc, VALUE *argv, VALUE self)
70
71
  int timeout = 1;
71
72
  FrtLock *lock;
72
73
  GET_LOCK(lock, self);
74
+ bool got_lock = false;
75
+ bool got_timeout = false;
76
+ time_t end_t;
73
77
 
74
78
  if (rb_scan_args(argc, argv, "01", &rtimeout) > 0) {
75
79
  timeout = FIX2INT(rtimeout);
76
80
  }
77
- /* TODO: use the lock timeout */
78
- (void)timeout;
79
- if (!lock->obtain(lock)) {
81
+ end_t = time(NULL) + timeout;
82
+ if (lock->obtain(lock)) {
83
+ got_lock = true;
84
+ }
85
+ while (!got_lock && !got_timeout) {
86
+ frt_micro_sleep(10000);
87
+ if (lock->obtain(lock)) {
88
+ got_lock = true;
89
+ } else if (time(NULL) >= end_t) {
90
+ got_timeout = true;
91
+ }
92
+ }
93
+ if (!got_lock) {
80
94
  rb_raise(cLockError, "could not obtain lock: #%s", lock->name);
81
95
  }
82
96
  return Qtrue;
@@ -103,11 +117,26 @@ frb_lock_while_locked(int argc, VALUE *argv, VALUE self)
103
117
  int timeout = 1;
104
118
  FrtLock *lock;
105
119
  GET_LOCK(lock, self);
120
+ bool got_lock = false;
121
+ bool got_timeout = false;
122
+ time_t end_t;
123
+
106
124
  if (rb_scan_args(argc, argv, "01", &rtimeout) > 0) {
107
125
  timeout = FIX2INT(rtimeout);
108
126
  }
109
- (void)timeout;
110
- if (!lock->obtain(lock)) {
127
+ end_t = time(NULL) + timeout;
128
+ if (lock->obtain(lock)) {
129
+ got_lock = true;
130
+ }
131
+ while (!got_lock && !got_timeout) {
132
+ frt_micro_sleep(10000);
133
+ if (lock->obtain(lock)) {
134
+ got_lock = true;
135
+ } else if (time(NULL) >= end_t) {
136
+ got_timeout = true;
137
+ }
138
+ }
139
+ if (!got_lock) {
111
140
  rb_raise(cLockError, "could not obtain lock: #%s", lock->name);
112
141
  }
113
142
  rb_yield(Qnil);
@@ -236,7 +236,11 @@ Metrowerks:
236
236
  #endif
237
237
 
238
238
  #if defined __GNUC__
239
- # define POSH_COMPILER_STRING "Gnu GCC"
239
+ # if defined __MINGW32__
240
+ # define POSH_COMPILER_STRING "MingW Gnu GCC"
241
+ # else
242
+ # define POSH_COMPILER_STRING "Gnu GCC"
243
+ # endif
240
244
  # define POSH_COMPILER_GCC 1
241
245
  #endif
242
246
 
@@ -307,9 +311,13 @@ Metrowerks:
307
311
 
308
312
  #if defined __MINGW32__
309
313
  # define POSH_OS_MINGW 1
310
- # define POSH_OS_STRING "MinGW"
311
314
  # if defined _WIN64
312
315
  # define POSH_OS_WIN64 1
316
+ # define POSH_OS_STRING "Win64"
317
+ # elif defined _WIN32
318
+ # define POSH_OS_STRING "Win32"
319
+ # else
320
+ # define POSH_OS_STRING "MinGW"
313
321
  # endif
314
322
  #endif
315
323
 
@@ -474,7 +482,7 @@ Metrowerks:
474
482
  # define POSH_CPU_SPARC 1
475
483
  #endif
476
484
 
477
- #if defined ARM || defined __arm__ || defined _ARM || __aarch64__
485
+ #if defined ARM || defined __arm__ || defined _ARM || defined __aarch64__
478
486
  # define POSH_CPU_STRONGARM 1
479
487
  # define POSH_CPU_STRING "ARM"
480
488
  #endif
@@ -690,16 +698,6 @@ typedef unsigned long long posh_u64_t;
690
698
  # define POSH_I64_PRINTF_PREFIX "ll"
691
699
  #endif
692
700
 
693
- /* hack */
694
- #ifdef __MINGW32__
695
- #undef POSH_I64
696
- #undef POSH_U64
697
- #undef POSH_I64_PRINTF_PREFIX
698
- #define POSH_I64( x ) ((posh_i64_t)x)
699
- #define POSH_U64( x ) ((posh_u64_t)x)
700
- #define POSH_I64_PRINTF_PREFIX "I64"
701
- #endif
702
-
703
701
  /** Minimum value for a 64-bit signed integer */
704
702
  #define POSH_I64_MIN POSH_I64(0x8000000000000000)
705
703
  /** Maximum value for a 64-bit signed integer */
@@ -965,9 +963,3 @@ extern posh_i64_t POSH_ReadI64FromBig( const void *src );
965
963
  # endif /* POSH_64BIT_INTEGER */
966
964
 
967
965
  #endif
968
-
969
- #ifdef __cplusplus
970
- }
971
- #endif
972
-
973
-