Fix some portability problems (get it to compile, at least, on HP's cc)
authorTom Lane
Mon, 15 Oct 2001 18:49:40 +0000 (18:49 +0000)
committerTom Lane
Mon, 15 Oct 2001 18:49:40 +0000 (18:49 +0000)
contrib/dbase/dbf2pg.c
contrib/dblink/dblink.c

index 53c0314afb57ae0f832a8472b1331cc143bc61cf..c87c743e09670058bb89899cf617f0231fb8548a 100644 (file)
@@ -5,14 +5,12 @@
    oktober 1996: merged sources of dbf2msql.c and dbf2pg.c
    oktober 1997: removed msql support
 */
-#define HAVE_TERMIOS_H
-#define HAVE_ICONV_H
+#include "postgres_fe.h"
+
+#define HAVE_ICONV_H           /* should be somewhere else */
 
-#include 
 #include 
-#include 
 #include 
-#include 
 #include 
 #ifdef HAVE_TERMIOS_H
 #include 
 #include 
 #endif
 
-#include 
+#include "libpq-fe.h"
 #include "dbf.h"
 
 int    verbose = 0, upper = 0, lower = 0, create = 0, fieldlow = 0;
 int del = 0;
 unsigned int begin = 0, end = 0;
 unsigned int t_block = 0;
+
 #ifdef HAVE_ICONV_H
 char *charset_from=NULL;
 char *charset_to="ISO-8859-1";
@@ -158,12 +157,11 @@ int check_table(PGconn *conn, char *table) {
 }
 
 void usage(void){
-   printf("\
-dbf2pg
-usage: dbf2pg [-u | -l] [-h hostname] [-W] [-U username]
-              [-B transaction_size] [-F charset_from [-T charset_to]]
-              [-s oldname=newname[,oldname=newname[...]]] [-d dbase]
-              [-t table] [-c | -D] [-f] [-v[v]] dbf-file\n");
+   printf("dbf2pg\n"
+"usage: dbf2pg [-u | -l] [-h hostname] [-W] [-U username]\n"
+"              [-B transaction_size] [-F charset_from [-T charset_to]]\n"
+"              [-s oldname=newname[,oldname=newname[...]]] [-d dbase]\n"
+"              [-t table] [-c | -D] [-f] [-v[v]] dbf-file\n");
 }
 
 /* patch submitted by Jeffrey Y. Sue  */
index d457a76cbf9a8968c7be67823d2af3f7853fea8f..e858cfd0ba24606d2c583e61d0a1ca011f75bcb1 100644 (file)
@@ -111,7 +111,7 @@ dblink(PG_FUNCTION_ARGS)
                results->res = res;
                res = NULL;
 
-               (dblink_results *) fcinfo->flinfo->fn_extra = results;
+               fcinfo->flinfo->fn_extra = (void *) results;
 
                results = NULL;
                results = fcinfo->flinfo->fn_extra;