Re: [INTERFACES] psqlodbc

Поиск
Список
Период
Сортировка
От Aleksey Demakov
Тема Re: [INTERFACES] psqlodbc
Дата
Msg-id 867m0y8oee.fsf@avd.gcom.ru
обсуждение исходный текст
Ответ на psqlodbc  ("Thomas G. Lockhart" <lockhart@alumni.caltech.edu>)
Список pgsql-interfaces
"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


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

В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Pap Tibor
Дата:
Сообщение: JDBC or JDK problem? Can't find class...
Следующее
От: Cyril Ferrand
Дата:
Сообщение: Re: [INTERFACES] JDBC or JDK problem? Can't find class...