summaryrefslogtreecommitdiff
path: root/src/log.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2023-02-23 09:38:12 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2023-05-03 23:11:35 -0400
commiteae1bbac182f9966ec652cce954f65c9046463a0 (patch)
tree5234fba7c935fe58bf4e522ab303a7a8af793403 /src/log.c
parent350fda32ef3230e0ccbbec44a0894bb319292309 (diff)
downloadlighttpd-git-eae1bbac182f9966ec652cce954f65c9046463a0.tar.gz
[build] _WIN32 shared dll build (autotools, cmake)
There are likely better and cleaner ways to do this; patches welcome. _WIN32 symbol imports and exports MS Visual Studio (_MSC_VER) does not appear to export global data symbols even when exporting all functions. Annotating any symbols with __declspec(dllexport) in any translation unit appears to change default dll symbol implict export behavior. Currently, src/Makefile.am and CMakeLists.txt take different approaches (implib versus linking against executable which has exported symbols) x-ref: (improved solutions might possibly be constructed using these docs) https://sourceware.org/binutils/docs/ld/WIN32.html https://cmake.org/cmake/help/latest/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html https://stackoverflow.com/questions/225432/export-all-symbols-when-creating-a-dll
Diffstat (limited to 'src/log.c')
-rw-r--r--src/log.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/log.c b/src/log.c
index fe49433a..841d38a4 100644
--- a/src/log.c
+++ b/src/log.c
@@ -5,6 +5,9 @@
#include "first.h"
+#undef __declspec_dllimport__
+#define __declspec_dllimport__ __declspec_dllexport__
+
#include "log.h"
#include <sys/types.h>
@@ -31,9 +34,12 @@ static uint32_t tlen;
static char tstr[24]; /* 20 "%F %T" incl '\0' +2 ": " */
/* log_con_jqueue instance here to be defined in shared object (see base.h) */
+__declspec_dllexport__
connection *log_con_jqueue;
+__declspec_dllexport__
unix_time64_t log_epoch_secs = 0;
+__declspec_dllexport__
unix_time64_t log_monotonic_secs = 0;
#if !defined(HAVE_CLOCK_GETTIME) || !HAS_TIME_BITS64