diff options
author | Daniel Verkamp <daniel@drv.nu> | 2015-10-21 17:24:41 -0700 |
---|---|---|
committer | Ralph Giles <giles@mozilla.com> | 2016-04-20 10:36:00 -0700 |
commit | 6e9617371f7cf3f669a60d9540723a01f1128fc8 (patch) | |
tree | 1effbde8a3ffe06b5791ec47ad9ee1441db7dbb0 | |
parent | 787eee29b87f06390fb3a2f615a525205a84d1f4 (diff) | |
download | opus-6e9617371f7cf3f669a60d9540723a01f1128fc8.tar.gz |
win32: only use dllexport when building DLL
If building a static library, marking symbols as dllexport causes them
to be exported from the final executable. For example, run
objdump -x opus_demo.exe on a --disabled-shared build and look for the
export table; there should not be one in a normal Win32 .exe file, but
when linking static libopus, the exe exports all of the opus_* public
functions.
Use the libtool-defined DLL_EXPORT flag to determine whether we are
building a DLL and only specify __declspec(dllexport) in that case.
-rw-r--r-- | include/opus_defines.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/opus_defines.h b/include/opus_defines.h index 647ed5d6..315412dd 100644 --- a/include/opus_defines.h +++ b/include/opus_defines.h @@ -65,7 +65,7 @@ extern "C" { #ifndef OPUS_EXPORT # if defined(WIN32) -# ifdef OPUS_BUILD +# if defined(OPUS_BUILD) && defined(DLL_EXPORT) # define OPUS_EXPORT __declspec(dllexport) # else # define OPUS_EXPORT |