src/utils/windll.c: add dll main entry point
authorPaul Brossier <piem@piem.org>
Sat, 23 Apr 2016 12:40:06 +0000 (14:40 +0200)
committerPaul Brossier <piem@piem.org>
Sat, 23 Apr 2016 12:40:06 +0000 (14:40 +0200)
src/utils/windll.c [new file with mode: 0644]

diff --git a/src/utils/windll.c b/src/utils/windll.c
new file mode 100644 (file)
index 0000000..fea5c5a
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+  Copyright (C) 2016 Paul Brossier <piem@aubio.org>
+
+  This file is part of aubio.
+
+  aubio is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  aubio is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with aubio.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+/** @file
+
+  Windows dll entry point.
+
+*/
+
+#ifdef HAVE_WIN_HACKS
+
+// latest version
+#include <SDKDDKVer.h>
+// for earlier versions, include WinSDKVer.h and set _WIN32_WINNT macro
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include "aubio.h"
+
+BOOL APIENTRY DllMain( HMODULE hModule,
+                       DWORD  ul_reason_for_call,
+                       LPVOID lpReserved )
+{
+  switch (ul_reason_for_call)
+  {
+    case DLL_PROCESS_ATTACH:
+    case DLL_THREAD_ATTACH:
+    case DLL_THREAD_DETACH:
+    case DLL_PROCESS_DETACH:
+      break;
+  }
+  return TRUE;
+}
+
+#endif