Author: turnstep
Date: Tue Feb 26 05:10:38 2008
New Revision: 10829

Modified:
   DBD-Pg/trunk/Pg.h
   DBD-Pg/trunk/Pg.xs
   DBD-Pg/trunk/dbdimp.c
   DBD-Pg/trunk/dbdimp.h
   DBD-Pg/trunk/quote.c
   DBD-Pg/trunk/quote.h
   DBD-Pg/trunk/types.c
   DBD-Pg/trunk/types.h

Log:
Call DBISTATE_DECLARE globally to fix recent compiler error, clean up header 
files while we're at it.


Modified: DBD-Pg/trunk/Pg.h
==============================================================================
--- DBD-Pg/trunk/Pg.h   (original)
+++ DBD-Pg/trunk/Pg.h   Tue Feb 26 05:10:38 2008
@@ -10,9 +10,16 @@
 
 */
 
+#include <strings.h>
+#include <math.h>
+#include <wchar.h>
 
 #ifdef WIN32
 static int errno;
+#define strcasecmp(s1,s2) lstrcmpiA((s1), (s2))
+#ifndef snprintf
+#define snprintf _snprintf
+#endif
 #endif
 
 #define DBDPG_TRUE (bool)1
@@ -21,6 +28,11 @@
 #define PG_OLDQUERY_CANCEL 2
 #define PG_OLDQUERY_WAIT 4
 
+/* Force preprocessors to use this variable. Default to something valid yet 
noticeable */
+#ifndef PGLIBVERSION
+#define PGLIBVERSION 80009
+#endif
+
 #include "libpq-fe.h"
 
 #ifndef INV_READ
@@ -46,9 +58,11 @@
 
 #include <dbd_xsh.h>    /* installed by the DBI module */
 
+DBISTATE_DECLARE;
+
+#include "types.h"
 #include "dbdimp.h"
 #include "quote.h"
-#include "types.h"
 
 #define TLEVEL      (DBIS->debug & DBIc_TRACE_LEVEL_MASK)
 #define TFLAGS      (DBIS->debug & DBIc_TRACE_FLAGS_MASK)

Modified: DBD-Pg/trunk/Pg.xs
==============================================================================
--- DBD-Pg/trunk/Pg.xs  (original)
+++ DBD-Pg/trunk/Pg.xs  Tue Feb 26 05:10:38 2008
@@ -17,8 +17,6 @@
 #define strncasecmp(a,b,c) _strnicmp((a),(b),(c))
 #endif
 
-DBISTATE_DECLARE;
-
 MODULE = DBD::Pg       PACKAGE = DBD::Pg
 
 

Modified: DBD-Pg/trunk/dbdimp.c
==============================================================================
--- DBD-Pg/trunk/dbdimp.c       (original)
+++ DBD-Pg/trunk/dbdimp.c       Tue Feb 26 05:10:38 2008
@@ -14,24 +14,11 @@
 
 
 #include "Pg.h"
-#include <math.h>
-#include <wchar.h>
-#include <strings.h>
 
 #ifndef powf
 #define powf (float)pow
 #endif
 
-/* Force preprocessors to use this variable. Default to something valid yet 
noticeable */
-#ifndef PGLIBVERSION
-#define PGLIBVERSION 80009
-#endif
-
-#ifdef WIN32
-#define snprintf _snprintf
-#define strcasecmp(s1,s2) lstrcmpiA((s1), (s2))
-#endif
-
 #define sword signed int
 #define sb2 signed short
 #define ub2 unsigned short
@@ -91,8 +78,6 @@
 static int pg_db_start_txn (pTHX_ SV *dbh, imp_dbh_t *imp_dbh);
 static int handle_old_async(pTHX_ SV * handle, imp_dbh_t * imp_dbh, int 
asyncflag);
 
-DBISTATE_DECLARE;
-
 /* ================================================================== */
 void dbd_init (dbistate_t *dbistate)
 {

Modified: DBD-Pg/trunk/dbdimp.h
==============================================================================
--- DBD-Pg/trunk/dbdimp.h       (original)
+++ DBD-Pg/trunk/dbdimp.h       Tue Feb 26 05:10:38 2008
@@ -9,8 +9,6 @@
        License or the Artistic License, as specified in the Perl README file.
 */
 
-#include "types.h"
-
 /* Define drh implementor data structure */
 struct imp_drh_st {
        dbih_drc_t com; /* MUST be first element in structure */

Modified: DBD-Pg/trunk/quote.c
==============================================================================
--- DBD-Pg/trunk/quote.c        (original)
+++ DBD-Pg/trunk/quote.c        Tue Feb 26 05:10:38 2008
@@ -10,13 +10,6 @@
 */
 
 #include "Pg.h"
-#include "types.h"
-
-#ifdef WIN32
-#ifndef snprint
-#define snprintf _snprintf
-#endif
-#endif
 
 char * null_quote(const char *string, STRLEN len, STRLEN *retlen)
 {

Modified: DBD-Pg/trunk/quote.h
==============================================================================
--- DBD-Pg/trunk/quote.h        (original)
+++ DBD-Pg/trunk/quote.h        Tue Feb 26 05:10:38 2008
@@ -1,6 +1,4 @@
 
-#ifndef DBDQUOTEH
-#define DBDQUOTEH
 char * null_quote(const char *string, STRLEN len, STRLEN *retlen);
 char * quote_string(const char *string, STRLEN len, STRLEN *retlen);
 char * quote_bytea(char *string, STRLEN len, STRLEN *retlen);
@@ -16,4 +14,3 @@
 void dequote_sql_binary(char *string, STRLEN *retlen);
 void dequote_bool(char *string, STRLEN *retlen);
 void null_dequote(const char *string, STRLEN *retlen);
-#endif /*DBDQUOTEH*/

Modified: DBD-Pg/trunk/types.c
==============================================================================
--- DBD-Pg/trunk/types.c        (original)
+++ DBD-Pg/trunk/types.c        Tue Feb 26 05:10:38 2008
@@ -421,9 +421,6 @@
        Do not edit this file directly - it is generated by types.c
 *} . qq{/
 
-#ifndef DBDPGTYEPSH
-#define DBDPGTYEPSH
-
 typedef struct sql_type_info {
        int         type_id;
        char*   type_name;
@@ -452,7 +449,7 @@
        printf $newfh "#define %${maxlen}s  $pgtype{$_}{oid}\n", 
$pgtype{$_}{define};
 }
 
-print $newfh "\n#endif\n";
+print $newfh "\n";
 close $newfh;
 system("mv $file.tmp $file");
 print "Wrote $file\n";

Modified: DBD-Pg/trunk/types.h
==============================================================================
--- DBD-Pg/trunk/types.h        (original)
+++ DBD-Pg/trunk/types.h        Tue Feb 26 05:10:38 2008
@@ -2,9 +2,6 @@
        Do not edit this file directly - it is generated by types.c
 */
 
-#ifndef DBDPGTYEPSH
-#define DBDPGTYEPSH
-
 typedef struct sql_type_info {
        int         type_id;
        char*   type_name;
@@ -157,4 +154,3 @@
 #define          PG_XIDARRAY  1011
 #define          PG_XMLARRAY  143
 
-#endif

Reply via email to