AtomicSharpAPI.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // The above copyright notice and this permission notice shall be included in
  3. // all copies or substantial portions of the Software.
  4. //
  5. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11. // THE SOFTWARE.
  12. //
  13. #include "AtomicSharp.h"
  14. #ifdef ATOMIC_PLATFORM_WINDOWS
  15. #pragma warning(disable: 4244) // possible loss of data
  16. #define ATOMIC_EXPORT_API __declspec(dllexport)
  17. #else
  18. #define ATOMIC_EXPORT_API
  19. #endif
  20. using namespace Atomic;
  21. extern "C"
  22. {
  23. ATOMIC_EXPORT_API ClassID csb_RefCounted_GetClassID(RefCounted* refCounted)
  24. {
  25. if (!refCounted)
  26. return 0;
  27. return refCounted->GetClassID();
  28. }
  29. ATOMIC_EXPORT_API RefCounted* csb_AtomicEngine_GetSubsystem(const char* name)
  30. {
  31. return AtomicSharp::GetContext()->GetSubsystem(name);
  32. }
  33. }