Subject: | No ulong on OSX (dbdimp.c:1533: error: 'ulong' undeclared (first use in this function)) |
Trying to install 4.005 on OSX failed with the following:
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
cc -c -I/Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DBI -
I/usr/local/mysql/include -Os -arch ppc -fno-common -DDBD_MYSQL_INSERT_ID_IS_GOOD
-g -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -
I/usr/local/include -Os -DVERSION=\"4.005\" -DXS_VERSION=\"4.005\" "-
I/System/Library/Perl/5.8.6/darwin-thread-multi-2level/CORE" dbdimp.c
dbdimp.c: In function 'mysql_dr_connect':
dbdimp.c:1533: error: 'ulong' undeclared (first use in this function)
dbdimp.c:1533: error: (Each undeclared identifier is reported only once
dbdimp.c:1533: error: for each function it appears in.)
dbdimp.c:1533: error: parse error before numeric constant
dbdimp.c:1535: error: parse error before numeric constant
dbdimp.c:1649: error: parse error before numeric constant
make: *** [dbdimp.o] Error 1
the broken line is:
client_flag |= CLIENT_MULTI_STATEMENTS;
In mysql_com.h, there is this, which uses ulong:
#define CLIENT_MULTI_STATEMENTS (((ulong) 1) << 16) /* Enable/disable multi-stmt
support */
But ulong is not known, so the build fails.
Mysql have a ulong typedef in my_global.h:
./include/my_global.h:824:typedef unsigned long ulong; /* Short for unsigned
long */
I added #include my_global.h to the top of dbdimp.c, and my build completed OK.
My mysql version is 5.0.27, installed from the Mysql official packages for OSX.
"This is perl, v5.8.6 built for darwin-thread-multi-2level
(with 3 registered patches, see perl -V for more detail)"
Darwin [name] 8.10.0 Darwin Kernel Version 8.10.0: Wed May 23 16:50:59 PDT 2007;
root:xnu-792.21.3~1/RELEASE_PPC Power Macintosh powerpc