From 3899c83f219bf64ff839312f31ccf16142a929b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Fillod=2C=20F8CFE?= Date: Mon, 21 May 2007 21:41:59 +0000 Subject: [PATCH] cleanup and initial __BORLANDC__ support git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2201 7ae35d74-ebe9-4afe-98af-79ac388436b8 --- include/hamlib/rig_dll.h | 66 +++++++++++----------------------------- 1 file changed, 18 insertions(+), 48 deletions(-) diff --git a/include/hamlib/rig_dll.h b/include/hamlib/rig_dll.h index 443e505af..e6aa683ba 100644 --- a/include/hamlib/rig_dll.h +++ b/include/hamlib/rig_dll.h @@ -1,4 +1,4 @@ -/* $Id: rig_dll.h,v 1.10 2006-10-13 12:02:36 aa6e Exp $ */ +/* $Id: rig_dll.h,v 1.11 2007-05-21 21:41:59 fillods Exp $ */ /* * Provide definitions to compile in Windows @@ -11,48 +11,6 @@ * No effect in non-Windows environments. */ -/* - * Temporarily commented out, until cygwin port is sorted out - */ -#if 0 - -#if defined(__CYGWIN__) || defined(_WIN32) -# if defined(HAMLIB_DLL) -# if defined(HAMLIB_STATIC) -# undef HAMLIB_STATIC -# endif -# if defined(ALL_STATIC) -# undef ALL_STATIC -# endif -# endif -# undef HAMLIB_IMPEXP -# undef BACKEND_IMPEXP -# undef HAMLIB_API -# undef HAMLIB_EXPORT -# undef HAMLIB_EXPORT_VAR -# if defined(HAMLIB_DLL) && defined(IN_HAMLIB) -/* building a DLL */ -# define HAMLIB_IMPEXP __declspec(dllexport) -# define BACKEND_IMPEXP __declspec(dllexport) -# elif defined(HAMLIB_STATIC) || defined(ALL_STATIC) -/* building or linking to a static library */ -# define HAMLIB_IMPEXP -# define BACKEND_IMPEXP -# else -/* linking to the DLL */ -# define HAMLIB_IMPEXP __declspec(dllimport) -# define BACKEND_IMPEXP __declspec(dllexport) -# endif -# define HAMLIB_API __cdecl -# define HAMLIB_EXPORT(type) HAMLIB_IMPEXP type HAMLIB_API -# define HAMLIB_EXPORT_VAR(type) HAMLIB_IMPEXP type -# define BACKEND_EXPORT(type) BACKEND_IMPEXP type HAMLIB_API -# define BACKEND_EXPORT_VAR(type) BACKEND_IMPEXP type -#endif - -#endif - - #if defined(_WIN32) && !defined(__CYGWIN__) # undef HAMLIB_IMPEXP # undef BACKEND_IMPEXP @@ -61,17 +19,29 @@ # undef HAMLIB_EXPORT_VAR # undef BACKEND_EXPORT # undef BACKEND_EXPORT_VAR +# undef HAMLIB_DLL_IMPORT +# undef HAMLIB_DLL_EXPORT + +# if defined (__BORLANDC__) +# define HAMLIB_DLL_IMPORT __import +# define HAMLIB_DLL_EXPORT __export +# else +# define HAMLIB_DLL_IMPORT __declspec(dllimport) +# define HAMLIB_DLL_EXPORT __declspec(dllexport) +# endif + # ifdef DLL_EXPORT + /* HAMLIB_API may be set to __stdcall for VB, .. */ # define HAMLIB_API __cdecl # ifdef IN_HAMLIB -# define BACKEND_IMPEXP __declspec(dllexport) -# define HAMLIB_IMPEXP __declspec(dllexport) +# define BACKEND_IMPEXP HAMLIB_DLL_EXPORT +# define HAMLIB_IMPEXP HAMLIB_DLL_EXPORT # else -# define BACKEND_IMPEXP __declspec(dllexport) -# define HAMLIB_IMPEXP __declspec(dllimport) +# define BACKEND_IMPEXP HAMLIB_DLL_EXPORT +# define HAMLIB_IMPEXP HAMLIB_DLL_IMPORT # endif # else -# define HAMLIB_IMPEXP __declspec(dllimport) +# define HAMLIB_IMPEXP HAMLIB_DLL_IMPORT /* must be static build, no directive? */ # endif #endif