[prev in list] [next in list] [prev in thread] [next in thread] 

List:       msql-mysql-modules
Subject:    [Patch] DBD-mysql use of "long long" breaks win32 builds
From:       "Philippe M. Chiasson" <gozer () ectoplasm ! org>
Date:       2005-04-12 22:01:18
Message-ID: 425C452E.1000603 () ectoplasm ! org
[Download RAW message or body]


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)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic