From: Aleksey Demakov <avd@gcom.ru>
To: Thomas G. Lockhart <lockhart@alumni.caltech.edu>
To: byronn@insightdist.com
To: pgsql-interfaces@postgresql.org
Subject: Re: [INTERFACES] psqlodbc
Date: 28 Jul 1998 13:45:13 +0700
Message-ID: <867m0y8oee.fsf@avd.gcom.ru> (raw)
References: <35BD35D5.AAFAFC7D@alumni.caltech.edu>
"Thomas G. Lockhart" <lockhart@alumni.caltech.edu> writes:
>
> I'm trying to build the ODBC driver to use with an iODBC interface for
> the upcoming release of ApplixWare on Linux. I notice that in the last
> few days the psqlodbc distribution has acquired a Makefile and a
> README.Linux, but the build is not going very well.
>
> Has anyone tried to build on a Unix box recently? If so, how?? The first
> file fails on a WINAPI-ed typedef...
>
Try with this patch. Since I doubt anyone needs translation DLLs under
linux I simply ifdefed out some code. Though it's posible to use
dlopen/dlsym/dlclose instead of LoadLibrary/GetProcAddress/FreeLibrary...
Aleksey
inline patch 1: psqlodbc/connection.c, psqlodbc/connection.h (+12/-2 lines) download inline-1.patchdiff -c psqlodbc.old/connection.c psqlodbc/connection.c
*** psqlodbc.old/connection.c Tue Jul 28 13:03:23 1998
--- psqlodbc/connection.c Tue Jul 28 12:57:17 1998
***************
*** 380,390 ****
--- 380,392 ----
}
}
+ #ifndef UNIX
/* Check for translation dll */
if ( self->translation_handle) {
FreeLibrary (self->translation_handle);
self->translation_handle = NULL;
}
+ #endif
mylog("exit CC_Cleanup\n");
return TRUE;
***************
*** 393,399 ****
int
CC_set_translation (ConnectionClass *self)
{
!
if (self->translation_handle != NULL) {
FreeLibrary (self->translation_handle);
self->translation_handle = NULL;
--- 395,401 ----
int
CC_set_translation (ConnectionClass *self)
{
! #ifndef UNIX
if (self->translation_handle != NULL) {
FreeLibrary (self->translation_handle);
self->translation_handle = NULL;
***************
*** 424,429 ****
--- 426,432 ----
self->errormsg = "Could not find translation DLL functions.";
return FALSE;
}
+ #endif
return TRUE;
}
diff -c psqlodbc.old/connection.h psqlodbc/connection.h
*** psqlodbc.old/connection.h Tue Jul 28 13:03:10 1998
--- psqlodbc/connection.h Tue Jul 28 12:36:56 1998
***************
*** 162,167 ****
--- 162,174 ----
char name[MAX_TABLE_LEN+1];
};
+ #ifdef UNIX+ #define WINAPI CALLBACK+ #define DLLHANDLE void *+ #else+ #define DLLHANDLE HINSTANCE+ #endif+
/* Translation DLL entry points */
typedef BOOL (FAR WINAPI *DataSourceToDriverProc) (UDWORD,
SWORD,
***************
*** 199,205 ****
int ntables;
COL_INFO **col_info;
long translation_option;
! HINSTANCE translation_handle;
DataSourceToDriverProc DataSourceToDriver;
DriverToDataSourceProc DriverToDataSource;
char transact_status; /* Is a transaction is currently in progress */
--- 206,212 ----
int ntables;
COL_INFO **col_info;
long translation_option;
! DLLHANDLE translation_handle;
DataSourceToDriverProc DataSourceToDriver;
DriverToDataSourceProc DriverToDataSource;
char transact_status; /* Is a transaction is currently in progress */
--
Aleksey Demakov
avd@gcom.ru
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 using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: avd@gcom.ru, lockhart@alumni.caltech.edu, byronn@insightdist.com
Subject: Re: [INTERFACES] psqlodbc
In-Reply-To: <867m0y8oee.fsf@avd.gcom.ru>
* 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