Polyphase Game Engine
Loading...
Searching...
No Matches
PolyphaseAPI.h
Go to the documentation of this file.
1#pragma once
2
15#ifdef _WIN32
16 // Suppress C4251: 'type' needs to have dll-interface to be used by clients
17 // This warning is about STL types in exported classes. It's safe to suppress
18 // because both the engine and addons use the same C++ runtime (MultiThreadedDLL).
19 #pragma warning(disable: 4251)
20 #pragma warning(disable: 4275) // Non-dll-interface base class
21
22 #ifdef POLYPHASE_ENGINE_EXPORT
23 // Building the engine - export symbols
24 #define POLYPHASE_API __declspec(dllexport)
25 #else
26 // Building a plugin/addon - import symbols from engine
27 #define POLYPHASE_API __declspec(dllimport)
28 #endif
29#else
30 // On Linux/other platforms, use visibility attribute
31 #define POLYPHASE_API __attribute__((visibility("default")))
32#endif
33
34// Convenience macro for classes that should be fully exported
35// Use: class POLYPHASE_API MyClass { ... };
36// This exports the class's vtable, RTTI, and all members
37
38// For template instantiations, use explicit instantiation:
39// extern template class POLYPHASE_API SmartPointer<MyClass>;
40
41// Backwards-compatibility aliases (deprecated, will be removed in a future version)
42#ifndef POLYPHASE_NO_LEGACY_MACROS
43 #define OCTAVE_API POLYPHASE_API
44 #define OCTAVE_IMGUI_EXPORT POLYPHASE_IMGUI_EXPORT
45 #define OCTAVE_ENGINE_EXPORT POLYPHASE_ENGINE_EXPORT
46 #define OCTAVE_VERSION POLYPHASE_VERSION
47 #define OCTAVE_VERSION_STRING POLYPHASE_VERSION_STRING
48 #define OCTAVE_REGISTER_PLUGIN POLYPHASE_REGISTER_PLUGIN
49#endif