Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1111)

Unified Diff: src/core/model/object-base.h

Issue 342870043: Visual Studio conditional code for core module (Closed)
Patch Set: Corrections Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/core/model/object-base.h
===================================================================
--- a/src/core/model/object-base.h
+++ b/src/core/model/object-base.h
@@ -24,6 +24,7 @@
#include "callback.h"
#include <string>
#include <list>
+#include "ns3dll.h"
/**
* \file
@@ -64,6 +65,26 @@
* If the template class is in a namespace, then the macro call should also be
* in the namespace.
*/
+#ifdef _WIN32
+#define NS_OBJECT_TEMPLATE_CLASS_DEFINE_LIB(type,param,lib) \
+ template class lib type<param>; \
+ template <> lib std::string DoGetTypeParamName<type<param> > () \
+ { \
+ return #param; \
+ } \
+ static struct Object ## type ## param ## Registrationclass \
+ { \
+ Object ## type ## param ## Registrationclass () { \
+ ns3::TypeId tid = type<param>::GetTypeId (); \
+ tid.SetSize (sizeof (type<param>)); \
+ tid.GetParent (); \
+ } \
+ } Object ## type ## param ## RegistrationVariable
+#else
+#define NS_OBJECT_TEMPLATE_CLASS_DEFINE_LIB(type,param,lib) \
+ NS_OBJECT_TEMPLATE_CLASS_DEFINE(type,param)
+#endif
+
#define NS_OBJECT_TEMPLATE_CLASS_DEFINE(type,param) \
Peter Barnes 2018/04/17 00:04:13 Can't this be implemented as #define NS_OBJECT_TE
ammo6818-vandals.uidaho.edu 2018/05/02 05:06:32 No, lines 70 and 71 are different.
template class type<param>; \
template <> std::string DoGetTypeParamName<type<param> > () \

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b