Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow physac to be built as a shared library #2168

Merged
merged 1 commit into from
Nov 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/extras/physac.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down