X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0389ED1B173 for ; Sun, 27 Jun 2004 13:19:01 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 13005-08 for ; Sun, 27 Jun 2004 16:18:52 +0000 (GMT) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by svr1.postgresql.org (Postfix) with SMTP id 5C7FAD1B1A1 for ; Sun, 27 Jun 2004 13:18:50 -0300 (ADT) Received: (qmail 18691 invoked by uid 65534); 27 Jun 2004 16:18:49 -0000 Received: from dsl-082-082-232-099.arcor-ip.net (EHLO colt.pezone.net) (82.82.232.99) by mail.gmx.net (mp006) with SMTP; 27 Jun 2004 18:18:49 +0200 X-Authenticated: #495269 From: Peter Eisentraut To: pgsql-odbc@postgresql.org Subject: Fixes for 64-bit architectures Date: Sun, 27 Jun 2004 18:18:48 +0200 User-Agent: KMail/1.5.1 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_oNv3A1Swf/EiEXv" Message-Id: <200406271818.48382.peter_e@gmx.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/53 X-Sequence-Number: 4123 --Boundary-00=_oNv3A1Swf/EiEXv Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline This patch fixes several misguided assumptions that sizeof(long) == 4, which is not true on 64-bit architectures. Please install it. --Boundary-00=_oNv3A1Swf/EiEXv Content-Type: text/x-diff; charset="us-ascii"; name="psqlodbc-64bit.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="psqlodbc-64bit.patch" 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 ! # else ! # if defined(HAVE_STDINT_H) ! # include ! # 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); --Boundary-00=_oNv3A1Swf/EiEXv--