From 482a621e314ccf37e757cf11bc045245dee68641 Mon Sep 17 00:00:00 2001 From: Shiqing Fan Date: Tue, 9 Nov 2010 16:13:30 +0000 Subject: [PATCH] Change the behavior of exporting/importing symbols on Windows, so that to fit the new build procedure, i.e. import statically linked opal/orte libraries for other libraries/binaries. There are several use cases when creating dll libraries: 1. create DLL A, export symbols of A, import nothing (A normally is OPAL) should define _USRDLL , A_EXPORT 2. create DLL B, export symbols of B, import A.lib (B could be ORTE, OMPI or other ompi tools) should define _USRDLL, B_EXPORT 3. create DLL C, import B.dll (C could be external libs or apps) should define B_IMPORT This commit was SVN r24016. --- ompi/include/ompi_config.h.in | 6 +++++- opal/include/opal_config_bottom.h | 6 +++++- orte/include/orte_config.h.in | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ompi/include/ompi_config.h.in b/ompi/include/ompi_config.h.in index 04f91de11e..6fdf734a40 100644 --- a/ompi/include/ompi_config.h.in +++ b/ompi/include/ompi_config.h.in @@ -86,7 +86,11 @@ typedef struct { # define OMPI_DECLSPEC __declspec(dllexport) # define OMPI_MODULE_DECLSPEC # else -# define OMPI_DECLSPEC __declspec(dllimport) +# if defined(OMPI_IMPORTS) +# define OMPI_DECLSPEC __declspec(dllimport) +# else +# define OMPI_DECLSPEC +# endif /*defined(OMPI_IMPORTS)*/ # if defined(OMPI_MODULE_EXPORTS) # define OMPI_MODULE_DECLSPEC __declspec(dllexport) # else diff --git a/opal/include/opal_config_bottom.h b/opal/include/opal_config_bottom.h index cb210e9e46..7e5038356c 100644 --- a/opal/include/opal_config_bottom.h +++ b/opal/include/opal_config_bottom.h @@ -240,7 +240,11 @@ # define OPAL_DECLSPEC __declspec(dllexport) # define OPAL_MODULE_DECLSPEC # else -# define OPAL_DECLSPEC +# if defined(OPAL_IMPORTS) +# define OPAL_DECLSPEC __declspec(dllimport) +# else +# define OPAL_DECLSPEC +# endif /*defined(OPAL_IMPORTS)*/ # if defined(OPAL_MODULE_EXPORTS) # define OPAL_MODULE_DECLSPEC __declspec(dllexport) # else diff --git a/orte/include/orte_config.h.in b/orte/include/orte_config.h.in index 8bd31716b2..2c33110a37 100644 --- a/orte/include/orte_config.h.in +++ b/orte/include/orte_config.h.in @@ -35,7 +35,11 @@ # define ORTE_DECLSPEC __declspec(dllexport) # define ORTE_MODULE_DECLSPEC # else -# define ORTE_DECLSPEC __declspec(dllimport) +# if defined(ORTE_IMPORTS) +# define ORTE_DECLSPEC __declspec(dllimport) +# else +# define ORTE_DECLSPEC +# endif /*defined(ORTE_IMPORTS)*/ # if defined(ORTE_MODULE_EXPORTS) # define ORTE_MODULE_DECLSPEC __declspec(dllexport) # else