summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-01-02 13:10:27 -0800
committerJosh Blum <josh@joshknows.com>2011-01-02 13:10:27 -0800
commite2487eb7311d6bbeec5e6aaeab0a3857d8cada1b (patch)
tree0abd11b40a1a7a72db2359ece9205320fec67d86 /host
parentea20cc274cdd7ea15df2347e9d1a3539bd819bed (diff)
downloaduhd-e2487eb7311d6bbeec5e6aaeab0a3857d8cada1b.tar.gz
uhd-e2487eb7311d6bbeec5e6aaeab0a3857d8cada1b.tar.bz2
uhd-e2487eb7311d6bbeec5e6aaeab0a3857d8cada1b.zip
uhd: potential fix for explicit template + llvm
Diffstat (limited to 'host')
-rw-r--r--host/include/uhd/config.hpp16
-rw-r--r--host/lib/types.cpp2
2 files changed, 12 insertions, 6 deletions
diff --git a/host/include/uhd/config.hpp b/host/include/uhd/config.hpp
index 9a29fb246..6200e6339 100644
--- a/host/include/uhd/config.hpp
+++ b/host/include/uhd/config.hpp
@@ -56,17 +56,14 @@
#define UHD_HELPER_DLL_IMPORT __declspec(dllimport)
#define UHD_HELPER_DLL_EXPORT __declspec(dllexport)
#define UHD_HELPER_DLL_LOCAL
- #define UHD_HELPER_EXIM_TMPL
#elif defined(__GNUG__) && __GNUG__ >= 4
#define UHD_HELPER_DLL_IMPORT __attribute__ ((visibility("default")))
#define UHD_HELPER_DLL_EXPORT __attribute__ ((visibility("default")))
#define UHD_HELPER_DLL_LOCAL __attribute__ ((visibility("hidden")))
- #define UHD_HELPER_EXIM_TMPL extern
#else
#define UHD_HELPER_DLL_IMPORT
#define UHD_HELPER_DLL_EXPORT
#define UHD_HELPER_DLL_LOCAL
- #define UHD_HELPER_EXIM_TMPL extern
#endif
// Now we use the generic helper definitions above to define UHD_API and UHD_LOCAL.
@@ -78,16 +75,13 @@
#ifdef UHD_DLL // defined if UHD is compiled as a DLL
#ifdef UHD_DLL_EXPORTS // defined if we are building the UHD DLL (instead of using it)
#define UHD_API UHD_HELPER_DLL_EXPORT
- #define UHD_EXIM_TMPL UHD_HELPER_EXIM_TMPL
#else
#define UHD_API UHD_HELPER_DLL_IMPORT
- #define UHD_EXIM_TMPL UHD_HELPER_EXIM_TMPL
#endif // UHD_DLL_EXPORTS
#define UHD_LOCAL UHD_HELPER_DLL_LOCAL
#else // UHD_DLL is not defined: this means UHD is a static lib.
#define UHD_API
#define UHD_LOCAL
- #define UHD_EXIM_TMPL
#endif // UHD_DLL
// Define force inline macro
@@ -119,4 +113,14 @@
#define UHD_PLATFORM_MACOS
#endif
+//On macos platform, explicit templates must be:
+// - defined with extern in the header file
+// - defined as a symbol in the source file
+#ifdef UHD_PLATFORM_MACOS
+ #define UHD_EXIM_TMPL extern
+ #define UHD_USE_EXIM_TMPL
+#else
+ #define UHD_EXIM_TMPL
+#endif
+
#endif /* INCLUDED_UHD_CONFIG_HPP */
diff --git a/host/lib/types.cpp b/host/lib/types.cpp
index bea20a4aa..9e4a26c23 100644
--- a/host/lib/types.cpp
+++ b/host/lib/types.cpp
@@ -43,8 +43,10 @@ using namespace uhd;
/***********************************************************************
* ranges template instantiation
**********************************************************************/
+#ifdef UHD_USE_EXIM_TMPL
template struct uhd::meta_range_t<float>;
template struct uhd::meta_range_t<double>;
+#endif
/***********************************************************************
* tune request