pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-odbc@postgresql.org
Subject: Fixes for 64-bit architectures
Date: Sun, 27 Jun 2004 18:18:48 +0200
Message-ID: <200406271818.48382.peter_e@gmx.net> (raw )
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);
view thread (2+ messages) latest in thread
Message-ID: <200406271818.48382.peter_e@gmx.net>
Permalink: ../200406271818.48382.peter_e@gmx.net/
Also on: postgresql.org/message-id/200406271818.48382.peter_e@gmx.net
copy link · copy postgr.es · copy git am
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: peter_e@gmx.net
Subject: Re: Fixes for 64-bit architectures
In-Reply-To: <200406271818.48382.peter_e@gmx.net>
References: <200406271818.48382.peter_e@gmx.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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