[Patch] DBD-mysql use of "long long" breaks win32 builds

"Philippe M. Chiasson" <[email protected]>
Newsgroups gmane.comp.db.mysql.perl
Message-ID <[email protected]>
my_ulonglong does correctly map to 'long long' or __int64 on win32 platforms.

The following patch fixes compilation failures on win32:

Index: DBD-mysql/dbdimp.c
--- DBD-mysql/dbdimp.c.~1~	Tue Apr 12 14:57:28 2005
+++ DBD-mysql/dbdimp.c	Tue Apr 12 14:57:28 2005
@@ -1716,7 +1716,7 @@
     else
       rows= mysql_num_rows(*cdaPtr);

-    if ((long long)rows == -1)
+    if ((my_ulonglong)rows == -1)
     {
       if (dbis->debug >= 2)
 	    PerlIO_printf(DBILOGFP,
@@ -1796,7 +1796,7 @@
 		      imp_sth->row_num);
     }

-    if ((long long) imp_sth->row_num == -1)
+    if ((my_ulonglong) imp_sth->row_num == -1)
       return -1;
     else
       return (int) imp_sth->row_num;
Index: DBD-mysql/mysql.xs
--- DBD-mysql/mysql.xs.~1~	Tue Apr 12 14:57:28 2005
+++ DBD-mysql/mysql.xs	Tue Apr 12 14:57:28 2005
@@ -300,7 +300,7 @@
   /* fix to make rows able to handle errors and handle max value from
      affected rows
   */
-  if ((long long)imp_sth->row_num ==  -1)
+  if ((my_ulonglong)imp_sth->row_num ==  -1)
     sprintf(buf, "%d", -1);
   else
     sprintf(buf, "%llu", imp_sth->row_num);

--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
signature.asc (application/pgp-signature, 251 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFCXEU0yzKhB4jDpaURA6P1AJ9Ec9EGilfUraNQCGFcwIOc+uvaXACdGMQm
USd7eK9aVCeOMcRr9zzksDE=
=ge/O
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.