Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] psqlodbc

From: Aleksey Demakov <avd(at)gcom(dot)ru>
To: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>, byronn(at)insightdist(dot)com, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: [INTERFACES] psqlodbc
Date: 1998-07-28 06:45:13
Message-ID: 867m0y8oee.fsf@avd.gcom.ru (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-interfaces
"Thomas G. Lockhart" <lockhart(at)alumni(dot)caltech(dot)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


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(at)gcom(dot)ru

In response to

  • psqlodbc at 1998-07-28 02:22:13 from Thomas G. Lockhart

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 1998-07-28 07:11:18
Subject: Re: [GENERAL] Re: [HACKERS] [Fwd: SGVLLUG Oracle and Informix on Linux]
Previous:From: Vadim MikheevDate: 1998-07-28 02:57:35
Subject: Re: [HACKERS] Bogus "Non-functional update" notices

pgsql-interfaces by date

Next:From: Cyril FerrandDate: 1998-07-28 07:05:23
Subject: Re: [INTERFACES] JDBC or JDK problem? Can't find class...
Previous:From: Pap TiborDate: 1998-07-28 06:07:38
Subject: JDBC or JDK problem? Can't find class...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group