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
104104 asplode h unless have_header h
105105end
106106
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+
107113# These gcc style flags are also supported by clang and xcode compilers,
108114# so we'll use a does-it-work test instead of an is-it-gcc test.
109115gcc_flags = ' -Wall -funroll-loops'
Original file line number Diff line number Diff line change 11#ifndef MYSQL2_EXT
22#define MYSQL2_EXT
33
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+
412/* tell rbx not to use it's caching compat layer
513 by doing this we're making a promise to RBX that
614 we'll never modify the pointers we get back from RSTRING_PTR */
You can’t perform that action at this time.
0 commit comments