summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2015-05-06 17:21:30 +0200
committerBenoit Foucher <benoit@zeroc.com>2015-05-06 17:21:30 +0200
commit0015b0097b89806b407e38df9399c358a82646f7 (patch)
treee07664cfc01e1fe8dbd4a83b88363ef170ab237c /cpp/src/slice2cpp
parentICE-6484 java exceptions test fails with --cross=js (diff)
downloadice-0015b0097b89806b407e38df9399c358a82646f7.tar.bz2
ice-0015b0097b89806b407e38df9399c358a82646f7.tar.xz
ice-0015b0097b89806b407e38df9399c358a82646f7.zip
Fixed generated code to not instantiate templates if ICE_STATIC_LIBS is defined, minor WinRT test fixes
Diffstat (limited to 'cpp/src/slice2cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 9e8d68722cb..74bf4315893 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -5177,7 +5177,8 @@ Slice::Gen::StreamVisitor::visitStructStart(const StructPtr& p)
//
// We tell "importers" that the implementation exports these instantiations
//
- H << nl << "#if defined(ICE_HAS_DECLSPEC_IMPORT_EXPORT) && !defined(" << _dllExport.substr(0, _dllExport.size() - 1) + "_EXPORTS)";
+ H << nl << "#if defined(ICE_HAS_DECLSPEC_IMPORT_EXPORT) && !defined(";
+ H << _dllExport.substr(0, _dllExport.size() - 1) + "_EXPORTS) && !defined(ICE_STATIC_LIBS)";
H << nl << "template struct " << _dllExport << "StreamWriter< " << fullStructName << ", ::IceInternal::BasicStream>;";
H << nl << "template struct " << _dllExport << "StreamReader< " << fullStructName << ", ::IceInternal::BasicStream>;";
H << nl << "#endif" << nl;
@@ -5185,7 +5186,7 @@ Slice::Gen::StreamVisitor::visitStructStart(const StructPtr& p)
//
// The instantations:
//
- C << nl << "#ifdef ICE_HAS_DECLSPEC_IMPORT_EXPORT";
+ C << nl << "#if defined(ICE_HAS_DECLSPEC_IMPORT_EXPORT) && !defined(ICE_STATIC_LIBS)";
C << nl << "template struct " << _dllExport << "StreamWriter< " << fullStructName << ", ::IceInternal::BasicStream>;";
C << nl << "template struct " << _dllExport << "StreamReader< " << fullStructName << ", ::IceInternal::BasicStream>;";
C << nl << "#endif";