summaryrefslogtreecommitdiffhomepage
path: root/src/extras
diff options
context:
space:
mode:
authorNovaleaf <[email protected]>2021-11-23 13:21:01 -0800
committerGitHub <[email protected]>2021-11-23 22:21:01 +0100
commitc5fc7c764037d474dcbde3fdcc17439699ff200e (patch)
tree9de5ea7054f9655a38a1f2bcd27717081bbd8064 /src/extras
parent460eba53c7f84473862eaad330cb2d3ff0e120ca (diff)
downloadraylib-c5fc7c764037d474dcbde3fdcc17439699ff200e.tar.gz
raylib-c5fc7c764037d474dcbde3fdcc17439699ff200e.zip
allow physac to be built as a shared library (#2168)
if `BUILD_LIBTYPE_SHARED` is defined allow build as a shared dll
Diffstat (limited to 'src/extras')
-rw-r--r--src/extras/physac.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/extras/physac.h b/src/extras/physac.h
index 642c25a7..a10f96dd 100644
--- a/src/extras/physac.h
+++ b/src/extras/physac.h
@@ -72,6 +72,16 @@
#if !defined(PHYSAC_H)
#define PHYSAC_H
+// Function specifiers in case library is build/used as a shared library (Windows)
+// NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll
+#if defined(_WIN32)
+ #if defined(BUILD_LIBTYPE_SHARED)
+ #define PHYSACDEF __declspec(dllexport) // We are building the library as a Win32 shared library (.dll)
+ #elif defined(USE_LIBTYPE_SHARED)
+ #define PHYSACDEF __declspec(dllimport) // We are using the library as a Win32 shared library (.dll)
+ #endif
+#endif
+
#ifndef PHYSACDEF
#define PHYSACDEF // We are building or using physac as a static library
#endif