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

more updates to accommodate mingw64-gcc 14.1 with jq using setenv #179

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,14 @@ ifeq ($(WIN),0)
endif
endif
CONFIGURE_HOST=
CFLAGS_SETENV=
else
BUILD_SUBDIR=win/${DBG_SUBDIR}
EXE=.exe
CFLAGS+= -D__USE_MINGW_ANSI_STDIO -D_ISOC99_SOURCE
CFLAGS+= -Wl,--strip-all
CONFIGURE_HOST=--host=x86_64-w64-mingw32
CFLAGS_SETENV=-Dsetenv\(a,b,c\)=_putenv_s\(a,b\)
endif

CFLAGS+=-std=gnu11
Expand Down Expand Up @@ -386,7 +388,7 @@ lib-jq: ${JQ_LIB}

${JQ_BUNDLE_LIB}: ${JQ_SRC} # -D_REENTRANT needed for clang to not break
cd ${JQ_SRC} \
&& CC="${CC}" CFLAGS="${CFLAGS} -D_REENTRANT" ./configure \
&& CC="${CC}" CFLAGS="${CFLAGS} -D_REENTRANT ${CFLAGS_SETENV}" ./configure \
--prefix="${JQ_PREFIX}" \
--disable-maintainer-mode \
--without-oniguruma \
Expand All @@ -395,7 +397,7 @@ ${JQ_BUNDLE_LIB}: ${JQ_SRC} # -D_REENTRANT needed for clang to not break
--disable-shared \
--enable-static \
${CONFIGURE_HOST} \
&& (${MAKE} install -k || echo)
&& (${MAKE} install -k)

${JSONWRITER_OBJECT}: ${JSONWRITER_SRC}/jsonwriter.c
@mkdir -p `dirname "$@"`
Expand Down
10 changes: 0 additions & 10 deletions app/utils/dl.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@

#include <zsv/utils/dl.h>

#ifdef _WIN32

#include <windows.h>
#define RTLD_LAZY 0
void *dlsym(void* handle, const char* symbol) {
return (void *)GetProcAddress((HINSTANCE)(handle), (symbol));
}
#endif


void (*zsv_dlsym(void *restrict handle, const char *restrict name))(void) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
Expand Down
5 changes: 5 additions & 0 deletions app/utils/win/dl.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
#include <windows.h>
#include <zsv/utils/os.h>

#define RTLD_LAZY 0
void *dlsym(void* handle, const char* symbol) {
return (void *)GetProcAddress((HINSTANCE)(handle), (symbol));
}

void *dlopen(const char *dll_name, int flags) {
(void)flags;
wchar_t wbuf[PATH_MAX];
Expand Down
Loading