pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Fixes for 64-bit architectures
2+ messages / 2 participants
[nested] [flat]

* Fixes for 64-bit architectures
@ 2004-06-27 16:18 Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2004-06-27 16:18 UTC (permalink / raw)
  To: pgsql-odbc

This patch fixes several misguided assumptions that sizeof(long) == 4, 
which is not true on 64-bit architectures.  Please install it.

Attachments:

psqlodbc-64bit.patch (text/x-diff, 5.1K) download diff -cr ../cvs-psqlodbc/connection.h ./connection.h *** ../cvs-psqlodbc/connection.h 2004-01-06 10:58:19.000000000 +0100 --- ./connection.h 2004-06-27 14:35:05.000000000 +0200 *************** *** 358,364 **** int lobj_type; int ntables; COL_INFO **col_info; ! long translation_option; HINSTANCE translation_handle; DataSourceToDriverProc DataSourceToDriver; DriverToDataSourceProc DriverToDataSource; --- 358,364 ---- int lobj_type; int ntables; COL_INFO **col_info; ! UDWORD translation_option; HINSTANCE translation_handle; DataSourceToDriverProc DataSourceToDriver; DriverToDataSourceProc DriverToDataSource; diff -cr ../cvs-psqlodbc/dlg_specific.c ./dlg_specific.c *** ../cvs-psqlodbc/dlg_specific.c 2004-01-06 10:58:20.000000000 +0100 --- ./dlg_specific.c 2004-06-27 14:51:01.000000000 +0200 *************** *** 127,133 **** /* Abbrebiation is needed ? */ if (abbrev || strlen(connect_string) >= len) { ! unsigned long flag = 0; if (ci->disallow_premature) flag |= BIT_DISALLOWPREMATURE; if (ci->allow_keyset) --- 127,133 ---- /* Abbrebiation is needed ? */ if (abbrev || strlen(connect_string) >= len) { ! UInt4 flag = 0; if (ci->disallow_premature) flag |= BIT_DISALLOWPREMATURE; if (ci->allow_keyset) *************** *** 209,215 **** unfoldCXAttribute(ConnInfo *ci, const char *value) { int count; ! unsigned long flag; if (strlen(value) < 2) { --- 209,215 ---- unfoldCXAttribute(ConnInfo *ci, const char *value) { int count; ! UInt4 flag; if (strlen(value) < 2) { diff -cr ../cvs-psqlodbc/psqlodbc.h ./psqlodbc.h *** ../cvs-psqlodbc/psqlodbc.h 2004-02-04 09:55:28.000000000 +0100 --- ./psqlodbc.h 2004-06-27 14:45:09.000000000 +0200 *************** *** 58,85 **** #include "gpps.h" #endif #ifndef WIN32 - #define Int4 long int - #define UInt4 unsigned int - #define Int2 short - #define UInt2 unsigned short ! #if !defined(WITH_UNIXODBC) && !defined(WITH_IODBC) typedef float SFLOAT; typedef double SDOUBLE; ! #endif ! #ifndef CALLBACK ! #define CALLBACK ! #endif - #else - #define Int4 int - #define UInt4 unsigned int - #define Int2 short - #define UInt2 unsigned short #endif typedef UInt4 Oid; #ifndef WIN32 --- 58,98 ---- #include "gpps.h" #endif + #ifndef WIN32 ! # if defined(HAVE_INTTYPES_H) ! # include <inttypes.h> ! # else ! # if defined(HAVE_STDINT_H) ! # include <stdint.h> ! # endif ! # endif ! ! # define Int4 int32_t ! # define UInt4 uint32_t ! # define Int2 int16_t ! # define UInt2 uint16_t ! ! # if !defined(WITH_UNIXODBC) && !defined(WITH_IODBC) typedef float SFLOAT; typedef double SDOUBLE; ! # endif ! # ifndef CALLBACK ! # define CALLBACK ! # endif ! ! #else /* WIN32 */ ! ! # define Int4 int ! # define UInt4 unsigned int ! # define Int2 short ! # define UInt2 unsigned short #endif + typedef UInt4 Oid; #ifndef WIN32 diff -cr ../cvs-psqlodbc/socket.c ./socket.c *** ../cvs-psqlodbc/socket.c 2004-01-06 10:58:21.000000000 +0100 --- ./socket.c 2004-06-27 14:47:46.000000000 +0200 *************** *** 125,131 **** struct sockaddr_un *un; #endif /* HAVE_UNIX_SOCKETS */ int family, sLen; ! unsigned long iaddr; if (self->socket != -1) { --- 125,131 ---- struct sockaddr_un *un; #endif /* HAVE_UNIX_SOCKETS */ int family, sLen; ! in_addr_t iaddr; if (self->socket != -1) { diff -cr ../cvs-psqlodbc/statement.c ./statement.c *** ../cvs-psqlodbc/statement.c 2004-02-05 10:11:44.000000000 +0100 --- ./statement.c 2004-06-27 14:49:08.000000000 +0200 *************** *** 853,859 **** * just the current row number. But it could be more sophisticated * someday, such as mapping a key to a 32 bit value */ ! unsigned long SC_get_bookmark(StatementClass *self) { return (self->currTuple + 1); --- 853,859 ---- * just the current row number. But it could be more sophisticated * someday, such as mapping a key to a 32 bit value */ ! UInt4 SC_get_bookmark(StatementClass *self) { return (self->currTuple + 1); diff -cr ../cvs-psqlodbc/statement.h ./statement.h *** ../cvs-psqlodbc/statement.h 2004-02-05 10:11:44.000000000 +0100 --- ./statement.h 2004-06-27 14:49:43.000000000 +0200 *************** *** 339,345 **** void SC_free_params(StatementClass *self, char option); void SC_log_error(const char *func, const char *desc, const StatementClass *self); time_t SC_get_time(StatementClass *self); ! unsigned long SC_get_bookmark(StatementClass *self); RETCODE SC_pos_update(StatementClass *self, UWORD irow, UDWORD index); RETCODE SC_pos_delete(StatementClass *self, UWORD irow, UDWORD index); RETCODE SC_pos_refresh(StatementClass *self, UWORD irow, UDWORD index); --- 339,345 ---- void SC_free_params(StatementClass *self, char option); void SC_log_error(const char *func, const char *desc, const StatementClass *self); time_t SC_get_time(StatementClass *self); ! UInt4 SC_get_bookmark(StatementClass *self); RETCODE SC_pos_update(StatementClass *self, UWORD irow, UDWORD index); RETCODE SC_pos_delete(StatementClass *self, UWORD irow, UDWORD index); RETCODE SC_pos_refresh(StatementClass *self, UWORD irow, UDWORD index);
^ permalink raw reply [nested|flat] 2+ messages in thread

* Re: Fixes for 64-bit architectures
@ 2004-07-01 09:22 Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 0 replies; 2+ messages in thread

From: Dave Page @ 2004-07-01 09:22 UTC (permalink / raw)
  To: Peter Eisentraut <peter_e@gmx.net>; pgsql-odbc

 

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org 
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Peter Eisentraut
> Sent: 27 June 2004 17:19
> To: pgsql-odbc@postgresql.org
> Subject: [ODBC] Fixes for 64-bit architectures
> 
> This patch fixes several misguided assumptions that 
> sizeof(long) == 4, which is not true on 64-bit architectures. 
>  Please install it.

Applied with the following mod in socket.c.

#ifdef WIN32
        UInt4 iaddr;
#else
	in_addr_t iaddr;
#endif

Thanks, Dave.



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-07-01 09:22 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-06-27 16:18 Fixes for 64-bit architectures Peter Eisentraut <peter_e@gmx.net>
2004-07-01 09:22 Re: Fixes for 64-bit architectures Dave Page <dpage@vale-housing.co.uk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox