Received: from relay.gcom.ru (Garant-Siberia-RadioNET.gcom.ru [194.84.180.33] (may be forged)) by hub.org (8.8.8/8.7.5) with ESMTP id CAA05684 for ; Tue, 28 Jul 1998 02:38:02 -0400 (EDT) Received: (from uucp@localhost) by relay.gcom.ru (8.6.10/8.6.10) id NAA13498; Tue, 28 Jul 1998 13:37:47 +0700 Received: from avd.gcom.ru(194.84.180.56) via SMTP by Garant-Siberia-RadioNET.gcom.ru, id smtpd013494; Tue Jul 28 13:37:45 1998 Received: (from avd@localhost) by avd.gcom.ru (8.8.7/8.8.7) id NAA00201; Tue, 28 Jul 1998 13:45:14 +0700 (NSS) (envelope-from avd) Sender: avd@avd.gcom.ru To: "Thomas G. Lockhart" , byronn@insightdist.com, pgsql-interfaces@postgresql.org Subject: Re: [INTERFACES] psqlodbc References: <35BD35D5.AAFAFC7D@alumni.caltech.edu> From: Aleksey Demakov Date: 28 Jul 1998 13:45:13 +0700 In-Reply-To: "Thomas G. Lockhart"'s message of Tue, 28 Jul 1998 02:22:13 +0000 Message-ID: <867m0y8oee.fsf@avd.gcom.ru> Lines: 106 X-Mailer: Gnus v5.3/Emacs 19.34 "Thomas G. Lockhart" 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 diff -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