| 1 | /* |
| 2 | * Copyright (C) 2004 CreepLord ([email protected]) |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; either version 2 |
| 7 | * of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 17 | */ |
| 18 | #ifndef INCLUDED_RUNTIME_LIBS_H |
| 19 | #define INCLUDED_RUNTIME_LIBS_H |
| 20 | |
| 21 | #ifdef WIN32 |
| 22 | |
| 23 | # include <windows.h> /* for GetProcAddress() & LoadLibrary() & FreeLibrary() */ |
| 24 | # define OpenLibrary(l) LoadLibrary(l) |
| 25 | # define GetFunction(h,f) GetProcAddress((HINSTANCE)h,f) |
| 26 | # define CloseLibrary(h) FreeLibrary((HINSTANCE)h) |
| 27 | |
| 28 | # define MYSQL_LIB "libmysql.dll" |
| 29 | # define PGSQL_LIB "libpq.dll" |
| 30 | # define SQLITE3_LIB "sqlite3.dll" |
| 31 | # define ODBC_LIB "odbc32.dll" |
| 32 | |
| 33 | #else /* FIXME: will this work on all nix like systems? */ |
| 34 | |
| 35 | # include <dlfcn.h> /* for dlopen() & dlsym() & dlclose() */ |
| 36 | /* link to 'libdl.so' */ |
| 37 | # define OpenLibrary(l) dlopen(l, RTLD_LOCAL | RTLD_LAZY) /* is this the correct mode? */ |
| 38 | # define GetFunction(h,f) dlsym(h,f) |
| 39 | # define CloseLibrary(h) dlclose(h) |
| 40 | |
| 41 | # define MYSQL_LIB "libmysqlclient.so" |
| 42 | # define PGSQL_LIB "libpq.so" |
| 43 | # define ODBC_LIB "libodbc.so" |
| 44 | # define SQLITE3_LIB "libsqlite3.so" |
| 45 | |
| 46 | #endif |
| 47 | |
| 48 | #endif |