crashed odbc in CVS

Started by Karel Zakover 25 years ago4 messages
#1Karel Zak
zakkr@zf.jcu.cz

the today's CVS:

make[3]: Entering directory /home/PG_DEVEL/pgsql/src/interfaces/odbc'
gcc -I../../include -O2 -Wall -Wmissing-prototypes -Wmissing-declarations
-I.
-DHAVE_CONFIG_H -fpic -c -o misc.o misc.c
misc.c: In function 'mylog':
misc.c:71: 'PG_BINARY_W' undeclared (first use in this function)
misc.c:71: (Each undeclared identifier is reported only once
misc.c:71: for each function it appears in.)
misc.c: In function 'log':
misc.c:99: 'PG_BINARY_W' undeclared (first use in this function)
make[3]: *** [misc.o] Error 1
make[3]: Leaving directory /home/PG_DEVEL/pgsql/src/interfaces/odbc'

conf:

./configure --prefix=/usr/lib/postgresql \
--with-template=linux_i386 \
--with-tcl \
--enable-multibyte \
--with-odbc \
--enable-locale \
--with-maxbackends=64 \
--with-pgport=5432

Karel

#2Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Karel Zak (#1)
Re: crashed odbc in CVS

Oops. I thought that code included postgres.h. I have added a define
to psqlodbc.h. I added:

#ifdef WIN32
#define PG_BINARY O_BINARY
#define PG_BINARY_R "rb"
#define PG_BINARY_W "wb"
#else
#define PG_BINARY 0
#define PG_BINARY_R "r"
#define PG_BINARY_W "w"
#endif

Can you give it a try?

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#3Karel Zak
zakkr@zf.jcu.cz
In reply to: Bruce Momjian (#2)
1 attachment(s)
Re: crashed odbc in CVS

On Thu, 8 Jun 2000, Bruce Momjian wrote:

Oops. I thought that code included postgres.h. I have added a define
to psqlodbc.h. I added:

#ifdef WIN32
#define PG_BINARY O_BINARY
#define PG_BINARY_R "rb"
#define PG_BINARY_W "wb"
#else
#define PG_BINARY 0
#define PG_BINARY_R "r"
#define PG_BINARY_W "w"
#endif

Can you give it a try?

Yes, you are right --- bug is in psqlodbc.h, but it is to in 'ggps.c'.
In this file is not included "psqlodbc.h".

The patch is attached.

Right?

Karel

Attachments:

atext/plain; charset=US-ASCII; name=aDownload
diff -r -B -C2 odbc.org/gpps.c odbc/gpps.c
*** odbc.org/gpps.c	Thu Jun  8 12:05:35 2000
--- odbc/gpps.c	Thu Jun  8 18:50:33 2000
***************
*** 29,32 ****
--- 29,33 ----
  #include "gpps.h"
  #include "misc.h"
+ #include "psqlodbc.h"
  
  #ifndef TRUE
diff -r -B -C2 odbc.org/psqlodbc.h odbc/psqlodbc.h
*** odbc.org/psqlodbc.h	Thu Jun  8 12:05:36 2000
--- odbc/psqlodbc.h	Thu Jun  8 18:48:22 2000
***************
*** 167,170 ****
--- 167,181 ----
  #define PG_NUMERIC_MAX_SCALE		1000
  
+ #ifdef WIN32
+ #define PG_BINARY       O_BINARY
+ #define PG_BINARY_R     "rb"
+ #define PG_BINARY_W     "wb"
+ #else
+ #define PG_BINARY       0
+ #define PG_BINARY_R     "r"
+ #define PG_BINARY_W     "w"
+ #endif
+ 
+ 
  #include "misc.h"
  
#4Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Karel Zak (#3)
Re: crashed odbc in CVS

Yes, that is it. I move the PG_BINARY includes to misc.h. Seem like a
better place for them.

On Thu, 8 Jun 2000, Bruce Momjian wrote:

Oops. I thought that code included postgres.h. I have added a define
to psqlodbc.h. I added:

#ifdef WIN32
#define PG_BINARY O_BINARY
#define PG_BINARY_R "rb"
#define PG_BINARY_W "wb"
#else
#define PG_BINARY 0
#define PG_BINARY_R "r"
#define PG_BINARY_W "w"
#endif

Can you give it a try?

Yes, you are right --- bug is in psqlodbc.h, but it is to in 'ggps.c'.
In this file is not included "psqlodbc.h".

The patch is attached.

Right?

Karel

Content-Description:

diff -r -B -C2 odbc.org/gpps.c odbc/gpps.c
*** odbc.org/gpps.c	Thu Jun  8 12:05:35 2000
--- odbc/gpps.c	Thu Jun  8 18:50:33 2000
***************
*** 29,32 ****
--- 29,33 ----
#include "gpps.h"
#include "misc.h"
+ #include "psqlodbc.h"
#ifndef TRUE
diff -r -B -C2 odbc.org/psqlodbc.h odbc/psqlodbc.h
*** odbc.org/psqlodbc.h	Thu Jun  8 12:05:36 2000
--- odbc/psqlodbc.h	Thu Jun  8 18:48:22 2000
***************
*** 167,170 ****
--- 167,181 ----
#define PG_NUMERIC_MAX_SCALE		1000
+ #ifdef WIN32
+ #define PG_BINARY       O_BINARY
+ #define PG_BINARY_R     "rb"
+ #define PG_BINARY_W     "wb"
+ #else
+ #define PG_BINARY       0
+ #define PG_BINARY_R     "r"
+ #define PG_BINARY_W     "w"
+ #endif
+ 
+ 
#include "misc.h"
-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026