summaryrefslogtreecommitdiff
path: root/gst/gst.c
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2015-05-27 17:22:28 +0530
committerTim-Philipp Müller <tim@centricular.com>2015-05-27 13:21:03 +0100
commitb174ec6903ed81f44bdda0883297c028b021910c (patch)
tree83cc9dfd8e1f1d36a31880ac58e2fe59219e59cf /gst/gst.c
parent179ba9f1820ee2be4d52302f1c40045d298d2a44 (diff)
gst/gst.c: Add a warning about DllMain to prevent misuse
DllMain should not be relied on for anything except storing the DLL handle. It should also not be defined for static builds, but doing so is not straightforward and is mostly harmless, so let's just add a comment about that for now.
Diffstat (limited to 'gst/gst.c')
-rw-r--r--gst/gst.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gst/gst.c b/gst/gst.c
index cd9124240..fcd966c76 100644
--- a/gst/gst.c
+++ b/gst/gst.c
@@ -192,6 +192,17 @@ enum
*/
#ifdef G_OS_WIN32
+/* Note: DllMain is only called when DLLs are loaded or unloaded, so this will
+ * never be called if libgstreamer-1.0 is linked statically. Do not add any code
+ * here to, say, initialize variables or set things up since that will only
+ * happen for dynamically-built GStreamer.
+ *
+ * Also, ideally this should not be defined when GStreamer is built statically.
+ * i.e., it should be conditional on #ifdef DLL_EXPORT. It will be ignored, but
+ * if other libraries make the same mistake of defining it when building
+ * statically, there will be a symbol collision during linking. Fixing this
+ * requires one to build two object files: one for static linking and another
+ * for dynamic linking. */
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
BOOL WINAPI
DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)