File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,12 @@ def asplode lib
104
104
asplode h unless have_header h
105
105
end
106
106
107
+ mysql_h = [ prefix , 'mysql.h' ] . compact . join ( '/' )
108
+
109
+ # my_bool is replaced by C99 bool in MySQL 8.0, but we want
110
+ # to retain compatibility with the typedef in earlier MySQLs.
111
+ have_type ( 'my_bool' , mysql_h )
112
+
107
113
# These gcc style flags are also supported by clang and xcode compilers,
108
114
# so we'll use a does-it-work test instead of an is-it-gcc test.
109
115
gcc_flags = ' -Wall -funroll-loops'
Original file line number Diff line number Diff line change 1
1
#ifndef MYSQL2_EXT
2
2
#define MYSQL2_EXT
3
3
4
+ /* MySQL 8.0 replaces my_bool with C99 bool. Earlier versions of MySQL had
5
+ * a typedef to char. Gem users reported failures on big endian systems when
6
+ * using C99 bool types with older MySQLs due to mismatched behavior. */
7
+ #ifndef HAVE_TYPE_MY_BOOL
8
+ #include <stdbool.h>
9
+ typedef bool my_bool ;
10
+ #endif
11
+
4
12
/* tell rbx not to use it's caching compat layer
5
13
by doing this we're making a promise to RBX that
6
14
we'll never modify the pointers we get back from RSTRING_PTR */
You can’t perform that action at this time.
0 commit comments