Browse Source

added attribute.h

Michele Caini 6 years ago
parent
commit
250ef50361
2 changed files with 34 additions and 0 deletions
  1. 1 0
      src/entt/entt.hpp
  2. 33 0
      src/entt/lib/attribute.h

+ 1 - 0
src/entt/entt.hpp

@@ -17,6 +17,7 @@
 #include "entity/storage.hpp"
 #include "entity/utility.hpp"
 #include "entity/view.hpp"
+#include "lib/attribute.h"
 #include "locator/locator.hpp"
 #include "meta/factory.hpp"
 #include "meta/meta.hpp"

+ 33 - 0
src/entt/lib/attribute.h

@@ -0,0 +1,33 @@
+#ifndef ENTT_LIB_ATTRIBUTE_H
+#define ENTT_LIB_ATTRIBUTE_H
+
+
+#ifndef ENTT_EXPORT
+#   if defined _WIN32 || defined __CYGWIN__ || defined _MSC_VER
+#       define ENTT_EXPORT __declspec(dllexport)
+#       define ENTT_IMPORT __declspec(dllimport)
+#       define ENTT_HIDDEN
+#   elif defined __GNUC__ && __GNUC__ >= 4
+#       define ENTT_EXPORT __attribute__((visibility("default")))
+#       define ENTT_IMPORT __attribute__((visibility("default")))
+#       define ENTT_HIDDEN __attribute__((visibility("hidden")))
+#   else /* Unsupported compiler */
+#       define ENTT_EXPORT
+#       define ENTT_IMPORT
+#       define ENTT_HIDDEN
+#   endif
+#endif
+
+
+#ifndef ENTT_API
+#   if defined ENTT_API_EXPORT
+#       define ENTT_API ENTT_EXPORT
+#   elif defined ENTT_API_IMPORT
+#       define ENTT_API ENTT_IMPORT
+#   else /* No API */
+#       define ENTT_API
+#   endif
+#endif
+
+
+#endif // ENTT_LIB_ATTRIBUTE_H