Fix some portability problems (get it to compile, at least, on HP's cc)

This commit is contained in:
Tom Lane 2001-10-15 18:49:40 +00:00
parent 394925b60d
commit 1e2779117d
2 changed files with 11 additions and 13 deletions

View File

@ -5,14 +5,12 @@
oktober 1996: merged sources of dbf2msql.c and dbf2pg.c oktober 1996: merged sources of dbf2msql.c and dbf2pg.c
oktober 1997: removed msql support oktober 1997: removed msql support
*/ */
#define HAVE_TERMIOS_H #include "postgres_fe.h"
#define HAVE_ICONV_H
#define HAVE_ICONV_H /* should be somewhere else */
#include <stdio.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <string.h>
#include <ctype.h> #include <ctype.h>
#ifdef HAVE_TERMIOS_H #ifdef HAVE_TERMIOS_H
#include <termios.h> #include <termios.h>
@ -21,13 +19,14 @@
#include <iconv.h> #include <iconv.h>
#endif #endif
#include <libpq-fe.h> #include "libpq-fe.h"
#include "dbf.h" #include "dbf.h"
int verbose = 0, upper = 0, lower = 0, create = 0, fieldlow = 0; int verbose = 0, upper = 0, lower = 0, create = 0, fieldlow = 0;
int del = 0; int del = 0;
unsigned int begin = 0, end = 0; unsigned int begin = 0, end = 0;
unsigned int t_block = 0; unsigned int t_block = 0;
#ifdef HAVE_ICONV_H #ifdef HAVE_ICONV_H
char *charset_from=NULL; char *charset_from=NULL;
char *charset_to="ISO-8859-1"; char *charset_to="ISO-8859-1";
@ -158,12 +157,11 @@ int check_table(PGconn *conn, char *table) {
} }
void usage(void){ void usage(void){
printf("\ printf("dbf2pg\n"
dbf2pg "usage: dbf2pg [-u | -l] [-h hostname] [-W] [-U username]\n"
usage: dbf2pg [-u | -l] [-h hostname] [-W] [-U username] " [-B transaction_size] [-F charset_from [-T charset_to]]\n"
[-B transaction_size] [-F charset_from [-T charset_to]] " [-s oldname=newname[,oldname=newname[...]]] [-d dbase]\n"
[-s oldname=newname[,oldname=newname[...]]] [-d dbase] " [-t table] [-c | -D] [-f] [-v[v]] dbf-file\n");
[-t table] [-c | -D] [-f] [-v[v]] dbf-file\n");
} }
/* patch submitted by Jeffrey Y. Sue <jysue@aloha.net> */ /* patch submitted by Jeffrey Y. Sue <jysue@aloha.net> */

View File

@ -111,7 +111,7 @@ dblink(PG_FUNCTION_ARGS)
results->res = res; results->res = res;
res = NULL; res = NULL;
(dblink_results *) fcinfo->flinfo->fn_extra = results; fcinfo->flinfo->fn_extra = (void *) results;
results = NULL; results = NULL;
results = fcinfo->flinfo->fn_extra; results = fcinfo->flinfo->fn_extra;