Skip to content

Commit 1e27791

Browse files
committed
Fix some portability problems (get it to compile, at least, on HP's cc)
1 parent 394925b commit 1e27791

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

contrib/dbase/dbf2pg.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55
oktober 1996: merged sources of dbf2msql.c and dbf2pg.c
66
oktober 1997: removed msql support
77
*/
8-
#define HAVE_TERMIOS_H
9-
#define HAVE_ICONV_H
8+
#include "postgres_fe.h"
9+
10+
#define HAVE_ICONV_H /* should be somewhere else */
1011

11-
#include <stdio.h>
1212
#include <fcntl.h>
13-
#include <stdlib.h>
1413
#include <unistd.h>
15-
#include <string.h>
1614
#include <ctype.h>
1715
#ifdef HAVE_TERMIOS_H
1816
#include <termios.h>
@@ -21,13 +19,14 @@
2119
#include <iconv.h>
2220
#endif
2321

24-
#include <libpq-fe.h>
22+
#include "libpq-fe.h"
2523
#include "dbf.h"
2624

2725
int verbose = 0, upper = 0, lower = 0, create = 0, fieldlow = 0;
2826
int del = 0;
2927
unsigned int begin = 0, end = 0;
3028
unsigned int t_block = 0;
29+
3130
#ifdef HAVE_ICONV_H
3231
char *charset_from=NULL;
3332
char *charset_to="ISO-8859-1";
@@ -158,12 +157,11 @@ int check_table(PGconn *conn, char *table) {
158157
}
159158

160159
void usage(void){
161-
printf("\
162-
dbf2pg
163-
usage: dbf2pg [-u | -l] [-h hostname] [-W] [-U username]
164-
[-B transaction_size] [-F charset_from [-T charset_to]]
165-
[-s oldname=newname[,oldname=newname[...]]] [-d dbase]
166-
[-t table] [-c | -D] [-f] [-v[v]] dbf-file\n");
160+
printf("dbf2pg\n"
161+
"usage: dbf2pg [-u | -l] [-h hostname] [-W] [-U username]\n"
162+
" [-B transaction_size] [-F charset_from [-T charset_to]]\n"
163+
" [-s oldname=newname[,oldname=newname[...]]] [-d dbase]\n"
164+
" [-t table] [-c | -D] [-f] [-v[v]] dbf-file\n");
167165
}
168166

169167
/* patch submitted by Jeffrey Y. Sue <jysue@aloha.net> */

contrib/dblink/dblink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ dblink(PG_FUNCTION_ARGS)
111111
results->res = res;
112112
res = NULL;
113113

114-
(dblink_results *) fcinfo->flinfo->fn_extra = results;
114+
fcinfo->flinfo->fn_extra = (void *) results;
115115

116116
results = NULL;
117117
results = fcinfo->flinfo->fn_extra;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy