mwrap 2.2.0.1.g867b → 3.0.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
data/ext/mwrap/extconf.rb CHANGED
@@ -10,26 +10,22 @@ have_library 'urcu-bp' or abort 'liburcu-bp not found'
10
10
  have_library 'dl'
11
11
  have_library 'c'
12
12
  have_library 'execinfo' # FreeBSD
13
+ $defs << '-DHAVE_XXHASH' if have_header('xxhash.h')
13
14
 
14
- if try_link(<<'')
15
- int main(void) { return __builtin_add_overflow_p(0,0,(int)1); }
15
+ have_struct_member('struct sockaddr_un', 'sun_len', %w(sys/socket sys/un.h))
16
16
 
17
+ if try_link(<<EOC)
18
+ int main(void) { return __builtin_add_overflow_p(0,0,(int)1); }
19
+ EOC
17
20
  $defs << '-DHAVE_BUILTIN_ADD_OVERFLOW_P'
18
21
  end
19
22
 
20
- if try_link(<<'')
23
+ if try_link(<<EOC)
21
24
  int main(int a) { return __builtin_add_overflow(0,0,&a); }
22
-
25
+ EOC
23
26
  $defs << '-DHAVE_BUILTIN_ADD_OVERFLOW_P'
24
27
  else
25
28
  abort 'missing __builtin_add_overflow'
26
29
  end
27
30
 
28
- begin
29
- if n = GC::INTERNAL_CONSTANTS[:HEAP_PAGE_SIZE]
30
- $defs << "-DHEAP_PAGE_SIZE=#{n}"
31
- end
32
- rescue NameError
33
- end
34
-
35
31
  create_makefile 'mwrap'
data/ext/mwrap/gcc.h ADDED
@@ -0,0 +1,13 @@
1
+ /* CC0 (Public domain) - http://creativecommons.org/publicdomain/zero/1.0/ */
2
+ #ifndef GCC_H
3
+ #define GCC_H
4
+ #define ATTR_COLD __attribute__((cold))
5
+
6
+ #if __STDC_VERSION__ >= 201112
7
+ # define MWRAP_TSD _Thread_local
8
+ #elif defined(__GNUC__)
9
+ # define MWRAP_TSD __thread
10
+ #else
11
+ # error _Thread_local nor __thread supported
12
+ #endif
13
+ #endif /* GCC_H */