Commit 87c83a98 authored by Martin Straka's avatar Martin Straka

Merge branch 'mingw-w64-building' into 'develop'

Mingw w64 building

Modification have been performed in order to be able to build a 64-bit Windows extension for Firefox.

Relates to issue #69.

See merge request !1
parents cf19984c 1afcea02
......@@ -89,7 +89,7 @@ $(top_srcdir)/add-on/firefox/common/install.rdf: $(top_srcdir)/add-on/firefox/co
if EXTPKG_MOZZ_JC
TARGETS += \
mf-dnssec-tlsa-validator-@PACKAGE_VERSION@-js-ctypes.xpi
mf-dnssec-tlsa-validator-@PACKAGE_VERSION@-js-ctypes-$(OS_TARGET)$(XPCOM_ABI).xpi
BUILT_SOURCES += \
$(top_srcdir)/add-on/firefox/js-ctypes/content/dnsseclib.js \
......@@ -217,7 +217,7 @@ _dtvmjc_workdir/platform/libDANEcore-$(OS_TARGET)$(XPCOM_ABI_SUFF_64)$(SO_SUFF):
$(INSTALL) -m 644 $(top_srcdir)/core_js-ctypes/bits-64/libDANEcore$(SO_SUFF) $@ # FIXME: Ugly
$(STRIP) $@
mf-dnssec-tlsa-validator-@PACKAGE_VERSION@-js-ctypes.xpi: dtvmjc-jar-stamp dtvmjc-prefs-stamp dtvmjc-ballast-stamp $(JC_DNSSEC_CORE) $(JC_DANE_CORE)
mf-dnssec-tlsa-validator-@PACKAGE_VERSION@-js-ctypes-$(OS_TARGET)$(XPCOM_ABI).xpi: dtvmjc-jar-stamp dtvmjc-prefs-stamp dtvmjc-ballast-stamp $(JC_DNSSEC_CORE) $(JC_DANE_CORE)
-rm -f $@
cd _dtvmjc_workdir; \
zip -r $@ COPYING README icon.png Version CHANGELOG platform defaults chrome install.rdf chrome.manifest; \
......@@ -234,9 +234,9 @@ CLEANFILES += \
dtvmjc-jar-stamp \
dtvmjc-prefs-stamp \
dtvmjc-ballast-stamp \
mf-dnssec-tlsa-validator-@PACKAGE_VERSION@-js-ctypes.xpi
mf-dnssec-tlsa-validator-@PACKAGE_VERSION@-js-ctypes-$(OS_TARGET)$(XPCOM_ABI).xpi
install-data-local: mf-dnssec-tlsa-validator-@PACKAGE_VERSION@-js-ctypes.xpi
install-data-local: mf-dnssec-tlsa-validator-@PACKAGE_VERSION@-js-ctypes-$(OS_TARGET)$(XPCOM_ABI).xpi
@for dir in $(MF_JC_INSTDIRS); do \
echo $${dir}; \
$(INSTALL) -d -m 755 $${dir}/dnssec@nic.cz; \
......@@ -256,7 +256,7 @@ endif
if EXTPKG_MOZZ_NP
TARGETS += \
mf-dnssec-tlsa-validator-@PACKAGE_VERSION@-npapi.xpi
mf-dnssec-tlsa-validator-@PACKAGE_VERSION@-npapi-$(OS_TARGET)$(XPCOM_ABI).xpi
#BUILT_SOURCES +=
......@@ -339,7 +339,7 @@ dtvmnp-tlsa-core-stamp:
fi
touch $@
mf-dnssec-tlsa-validator-@PACKAGE_VERSION@-npapi.xpi: dtvmnp-jar-stamp dtvmnp-prefs-stamp dtvmnp-ballast-stamp dtvmnp-dnssec-core-stamp dtvmnp-tlsa-core-stamp
mf-dnssec-tlsa-validator-@PACKAGE_VERSION@-npapi-$(OS_TARGET)$(XPCOM_ABI).xpi: dtvmnp-jar-stamp dtvmnp-prefs-stamp dtvmnp-ballast-stamp dtvmnp-dnssec-core-stamp dtvmnp-tlsa-core-stamp
-rm -f $@
cd _dtvmnp_workdir; \
zip -r $@ COPYING README icon.png Version CHANGELOG plugins defaults chrome install.rdf chrome.manifest; \
......@@ -358,6 +358,6 @@ CLEANFILES += \
dtvmnp-ballast-stamp \
dtvmnp-dnssec-core-stamp \
dtvmnp-tlsa-core-stamp \
mf-dnssec-tlsa-validator-@PACKAGE_VERSION@-npapi.xpi
mf-dnssec-tlsa-validator-@PACKAGE_VERSION@-npapi-$(OS_TARGET)$(XPCOM_ABI).xpi
endif
......@@ -89,11 +89,6 @@ dnssec_init: function() {
abiStr = "x86";
}
/* Only 32-bit Windows at the moment. */
if (("WINNT" == osTgtStr) && ("x86_64" == abiStr)) {
abiStr = "x86";
}
/* Test for unsupported ABI. */
if ("unspecified" != abiStr) {
/* Packaged library (platform/core-os-arch.lib). */
......
......@@ -89,11 +89,6 @@ dane_init: function() {
abiStr = "x86";
}
/* Only 32-bit Windows at the moment. */
if (("WINNT" == osTgtStr) && ("x86_64" == abiStr)) {
abiStr = "x86";
}
/* Test for unsupported ABI. */
if ("unspecified" != abiStr) {
/* Packaged library (platform/core-os-arch.lib). */
......
......@@ -120,7 +120,7 @@ AS_CASE([$host_cpu],
[i[[3456]]86], [XPCOM_ABI=x86],
[amd64|x86_64], [XPCOM_ABI=x86_64],
)
#AC_SUBST(XPCOM_ABI)
AC_SUBST(XPCOM_ABI)
# Set shared library prefixes and suffixes.
AS_CASE([$host_os],
......@@ -303,17 +303,21 @@ AS_IF([test "x$enable_static_linking" = "xyes"], [
)
],
[mingw*], [
CORE_CPPFLAGS='-I$(top_srcdir)/static-libs/libs-built/windows/x86 '"${CORE_CPPFLAGS}"
CONFIGURE_ARGS="--host=\"$host_alias\" --target=\"$target_alias\""
OPENSSL_ARGS_32="--cross-compile-prefix=\"$host_alias-\" mingw enable-static-engine ${LIB_CFLAGS_32}"
OPENSSL_ARGS_64="--cross-compile-prefix=\"$host_alias-\" mingw64 enable-static-engine ${LIB_CFLAGS_64}"
CROSSCOMPILE_PREPARATION_EXPORTS="export CC=\"${host_alias}-gcc\" && export LD=\"${host_alias}-ld\" && "
CORE_CPPFLAGS_32='-I$(top_srcdir)/static-libs/libs-built-32/windows '"${CORE_CPPFLAGS_32}"
CORE_CPPFLAGS_64='-I$(top_srcdir)/static-libs/libs-built-64/windows '"${CORE_CPPFLAGS_64}"
AC_DEFINE(TGT_SYSTEM, TGT_WIN, [Target system is Windows.])
AC_DEFINE(__USE_MINGW_ANSI_STDIO, 1, [MinGW requires this for GNU format specifiers?])
AS_CASE([${BITS}],
[32], [
CONFIGURE_ARGS="--host=\"$host_alias\" --target=\"$target_alias\""
OPENSSL_ARGS_32="--cross-compile-prefix=\"$host_alias-\" mingw enable-static-engine ${LIB_CFLAGS_32}"
CROSSCOMPILE_PREPARATION_EXPORTS="export CC=\"${host_alias}-gcc\" && export LD=\"${host_alias}-ld\" && "
],
[64], [
],
[
AC_MSG_ERROR([You can only build 32-bit applications using MinGW.])
AC_MSG_ERROR([You can only build 32-bit or 64-bit applications using MinGW.])
]
)
]
......
......@@ -6,6 +6,12 @@ CONF_OPTS=""
CONF_OPTS="${CONF_OPTS} --enable-static-linking"
CONF_OPTS="${CONF_OPTS} --with-force-abi=fat"
#CONF_OPTS="${CONF_OPTS} --host=i586-mingw32msvc"
#CONF_OPTS="${CONF_OPTS} --host=i686-w64-mingw32"
#CONF_OPTS="${CONF_OPTS} --host=x86_64-w64-mingw32"
#CONF_OPTS="${CONF_OPTS} --with-win32-host=i686-w64-mingw32"
#CONF_OPTS="${CONF_OPTS} --with-win64-host=x86_64-w64-mingw32"
if [ "x$1" != "x" ]; then
for param in $@; do
case ${param} in
......
......@@ -94,21 +94,34 @@ endif
if MINGW_BUILD
# Libtool may fail on these when using MinGW.
.IGNORE: libDNSSECcore.la libDANEcore.la
CLEANFILES += \
libDNSSECcore.def \
libDANEcore.def
# Libtool refuses to link static archives into dynamic libraries, therefore
# the explicit linking.
# libldns contains inet_pton() and inet_ntop(), therefore it is laways linked.
# Sometimes explicit call of -pthread is needed (unbound 1.5.x).
#MINGW_PTHREAD = -pthread
# Created dynamic libraries are will libgcc_s_sjlj-1.dll if this parameter not specified.
MINGW_LIB_STATIC = -static-libgcc
# Libtool refuses to link static archives into dynamic libraries, therefore the explicit linking.
# libldns contains inet_pton() and inet_ntop(), therefore it is always linked (using DANE_CORE_STATIC_DEPS).
# Also, the commands may require winpthread-static to have installed.
DNSSEC_CORE_INSTALL_CMD = \
$(CC) -shared -Wl,--output-def,libDNSSECcore.def,-Bstatic,-Bsymbolic,-lws2_32,-liphlpapi,-lgdi32 \
$(CC) $(MINGW_PTHREAD) -shared $(MINGW_LIB_STATIC) -Wl,--output-def,libDNSSECcore.def,-Bstatic,-Bsymbolic,-lws2_32,-liphlpapi,-lgdi32,-lcrypt32 \
-Wl,--version-script=$(abs_top_builddir)/core_js-ctypes/libDNSSECcore.ver \
-o .libs/libDNSSECcore$(SO_SUFF) common.o dnssec-plug.o log_dflt.o \
$(DANE_CORE_STATIC_DEPS) -lws2_32 -liphlpapi -lgdi32
$(DANE_CORE_STATIC_DEPS) -lws2_32 -liphlpapi -lgdi32 -lcrypt32 && \
touch libDNSSECcore.la
DANE_CORE_INSTALL_CMD = \
$(CC) -shared -Wl,--output-def,libDANEcore.def,-Bstatic,-Bsymbolic,-lws2_32,-liphlpapi,-lgdi32,-lcrypt32 \
$(CC) $(MINGW_PTHREAD) -shared $(MINGW_LIB_STATIC) -Wl,--output-def,libDANEcore.def,-Bstatic,-Bsymbolic,-lws2_32,-liphlpapi,-lgdi32,-lcrypt32 \
-Wl,--version-script=$(abs_top_builddir)/core_js-ctypes/libDANEcore.ver \
-o .libs/libDANEcore$(SO_SUFF) common.o dane-plug.o log_dflt.o ca_store_win.o \
$(DANE_CORE_STATIC_DEPS) -lws2_32 -liphlpapi -lgdi32 -lcrypt32
$(DANE_CORE_STATIC_DEPS) -lws2_32 -liphlpapi -lgdi32 -lcrypt32 && \
touch libDANEcore.la
endif
......
......@@ -36,7 +36,7 @@ if STATIC_CORE
if MINGW_BUILD
# Libtool refuses to link static archives into dynamic libraries, therefore
# the explicit linking.
# libldns contains inet_pton() and inet_ntop(), therefore it is laways linked.
# libldns contains inet_pton() and inet_ntop(), therefore it is always linked.
dnssec_plug_LDADD += \
$(LDNS_STATIC_DEP)
endif
......@@ -48,8 +48,12 @@ dnssec_plug_LDADD += \
endif
if MINGW_BUILD
# Sometimes explicit call of -pthread is needed (unbound 1.5.x).
#dnssec_plug_LDFLAGS += \
# -pthread
dnssec_plug_LDADD += \
-lws2_32 -liphlpapi -lgdi32
-lws2_32 -liphlpapi -lgdi32 -lcrypt32
endif
......@@ -74,6 +78,10 @@ dane_plug_LDADD += \
endif
if MINGW_BUILD
# Sometimes explicit call of -pthread is needed (unbound 1.5.x).
#dane_plug_LDFLAGS += \
# -pthread
dane_plug_LDADD += \
-lws2_32 -liphlpapi -lgdi32 -lcrypt32
endif
......@@ -37,6 +37,7 @@ OpenSSL used as well as that of the covered work.
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
......@@ -51,12 +52,14 @@ OpenSSL used as well as that of the covered work.
#if TGT_SYSTEM == TGT_WIN
/* Windows */
#include "ldns/config.h"
#include <winsock2.h>
#include <ws2tcpip.h>
const char *inet_ntop(int af, const void *src, char *dst, size_t size);
int inet_pton(int af, const char* src, void* dst);
//#include "ldns/config.h"
#include "ldns/ldns.h"
//#include "libunbound/unbound.h"
#include "unbound.h"
#include <winsock2.h>
#include <ws2tcpip.h>
#include <iphlpapi.h>
#include <winreg.h>
#if malloc == rpl_malloc
......
......@@ -33,6 +33,9 @@ OpenSSL used as well as that of the covered work.
#include "config_related.h"
/* These have to be included before OpenSSL. */
#include <winsock2.h>
#include <wincrypt.h>
#include "ca_stores.h"
#include "common.h"
......@@ -41,12 +44,10 @@ OpenSSL used as well as that of the covered work.
#include "openssl/x509.h"
#include "openssl/evp.h"
#include "ldns/config.h"
//#include "ldns/config.h"
//#include "ldns/ldns.h"
//#include "libunbound/unbound.h"
#include <wincrypt.h>
#define MY_ENCODING_TYPE (PKCS_7_ASN_ENCODING | X509_ASN_ENCODING)
#ifndef CERT_SYSTEM_STORE_CURRENT_USER
......@@ -57,7 +58,7 @@ OpenSSL used as well as that of the covered work.
#define CERT_STORE_READONLY_FLAG 0x00008000
#endif
#ifndef CCERT_CLOSE_STORE_CHECK_FLAG
#ifndef CERT_CLOSE_STORE_CHECK_FLAG
#define CERT_CLOSE_STORE_CHECK_FLAG 0x00000002
#endif
......
......@@ -51,12 +51,19 @@ OpenSSL used as well as that of the covered work.
#include <errno.h>
#include <inttypes.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#if TGT_SYSTEM == TGT_WIN
/* These have to be included before OpenSSL. */
#include <winsock2.h>
#include <wincrypt.h>
#endif /**/
#include "ldns/wire2host.h"
#include "openssl/bio.h"
#include "openssl/evp.h"
......@@ -70,14 +77,13 @@ OpenSSL used as well as that of the covered work.
#if TGT_SYSTEM == TGT_WIN
/* Windows */
#include "ldns/config.h"
//#include "ldns/config.h"
#include <ws2tcpip.h>
//#include "ldns/config.h"
#include "ldns/ldns.h"
// #include "libunbound/unbound.h"
#include "unbound.h"
#include <wincrypt.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <iphlpapi.h>
#include <winreg.h>
......@@ -87,7 +93,7 @@ OpenSSL used as well as that of the covered work.
#define CERT_SYSTEM_STORE_CURRENT_USER 0x00010000
#endif
#ifndef CCERT_CLOSE_STORE_CHECK_FLAG
#ifndef CERT_CLOSE_STORE_CHECK_FLAG
#define CERT_CLOSE_STORE_CHECK_FLAG 0x00000002
#endif
......@@ -535,11 +541,11 @@ void print_tlsalist_debug(const struct tlsa_store_head *tlsa_list)
">> %04d ---------------------------------------\n", num);
printf_debug(DEBUG_PREFIX_TLSA,
"%s: dnssec: %s (%d), cert usage: %d, selector: %d, "
"matching type: %d, assoc.hex: %s, assoc.size: %zu \n",
"matching type: %d, assoc.hex: %s, assoc.size: %u \n",
tmp->domain, get_dnssec_status(tmp->dnssec_status),
tmp->dnssec_status, tmp->cert_usage, tmp->selector,
tmp->matching_type, tmp->assochex,
tmp->association_size);
(unsigned int) tmp->association_size);
printf_debug(DEBUG_PREFIX_TLSA,
"<< %04d ---------------------------------------\n", num);
++num;
......
......@@ -5,15 +5,41 @@ SRC_ROOT="${SCRIPT_LOCATION}/.."
cd "${SRC_ROOT}"
MINGW_PREFIX=i586-mingw32msvc # Unbound 1.5.1 requires patching.
#MINGW_PREFIX=i686-w64-mingw32 # Currently does not work.
USAGE="$0 [w32|w64]"
# NPAPI extension was built directly oin Visual Studio.
MINGW_PREFIX=""
if [ "x$1" = "x" ]; then
MINGW_PREFIX=i586-mingw32msvc # Unbound 1.5.x requires patching.
#MINGW_PREFIX=i686-w64-mingw32
#MINGW_PREFIX=x86_64-w64-mingw32
else
case "$1" in
"w32")
MINGW_PREFIX=i686-w64-mingw32
;;
"w64")
MINGW_PREFIX=x86_64-w64-mingw32
;;
*)
echo "Unknown option '$1'."
echo "Usage:"
echo "${USAGE}"
exit 1
;;
esac
fi
"${MINGW_PREFIX}-gcc" -v 2>/dev/null || echo "${MINGW_PREFIX}-gcc not found"
"${MINGW_PREFIX}-gcc" -v 2>/dev/null || exit 1
# NPAPI extension was built directly in Visual Studio.
CONF_OPTS=""
CONF_OPTS="${CONF_OPTS} --enable-static-linking"
#CONF_OPTS="${CONF_OPTS} --enable-npapi-extensions"
CONF_OPTS="${CONF_OPTS} --with-force-abi=x86"
# Don't force ABI, let the script decide.
#CONF_OPTS="${CONF_OPTS} --with-force-abi=x86"
CONF_OPTS="${CONF_OPTS} --host=${MINGW_PREFIX} --target=${MINGW_PREFIX}"
./configure ${CONF_OPTS}
......
......@@ -13,11 +13,10 @@ endif
DOWNLOADER = curl -O
# openssl-1.0.1i openssl-1.0.2h
PKG_OPENSSL = openssl-1.0.1i
PKG_OPENSSL = openssl-1.0.2j
PKG_LDNS = ldns-1.6.17
# unbound-1.4.22 unbound-1.5.9
PKG_UNBOUND = unbound-1.4.22
#PKG_UNBOUND = unbound-1.5.9
ARCHIVE_OPENSSL = $(PKG_OPENSSL).tar.gz
ARCHIVE_LDNS = $(PKG_LDNS).tar.gz
......@@ -74,14 +73,34 @@ srcs-ldns-64-stamp: libs-srcs-64-stamp
cd libs-srcs-64; tar -xzf ../libs-archives/$(ARCHIVE_LDNS); mv ldns-* ldns; cd ..
touch $@
if MINGW_BUILD
ifeq ($(PKG_UNBOUND), unbound-1.5.9)
PATCH_UNBOUND_CMD_32 = \
(cd libs-srcs-32/unbound && \
$(INSTALL) -m 644 ../../files/unbound-1.5.9-mingw-w64-compat.patch ./unbound-1.5.9-mingw-w64-compat.patch && \
$(INSTALL) -m 644 ../../files/unbound-mingw-w64-compat.h ./unbound-mingw-w64-compat.h && \
patch -p1 < ./unbound-1.5.9-mingw-w64-compat.patch)
PATCH_UNBOUND_CMD_64 = \
(cd libs-srcs-64/unbound && \
$(INSTALL) -m 644 ../../files/unbound-1.5.9-mingw-w64-compat.patch ./unbound-1.5.9-mingw-w64-compat.patch && \
$(INSTALL) -m 644 ../../files/unbound-mingw-w64-compat.h ./unbound-mingw-w64-compat.h && \
patch -p1 < ./unbound-1.5.9-mingw-w64-compat.patch)
endif
endif
srcs-unbound-32-stamp: libs-srcs-32-stamp
-rm -rf libs-srcs-32/unbound*
cd libs-srcs-32; tar -xzf ../libs-archives/$(ARCHIVE_UNBOUND); mv unbound-* unbound; cd ..
$(PATCH_UNBOUND_CMD_32)
touch $@
srcs-unbound-64-stamp: libs-srcs-64-stamp
-rm -rf libs-srcs-64/unbound*
cd libs-srcs-64; tar -xzf ../libs-archives/$(ARCHIVE_UNBOUND); mv unbound-* unbound; cd ..
$(PATCH_UNBOUND_CMD_64)
touch $@
libs-built-32-stamp:
......@@ -111,11 +130,22 @@ built-openssl-64-stamp: srcs-openssl-64-stamp libs-built-64-stamp
if MINGW_BUILD
COPY_HEADERS_CMD_32 = \
(cd libs-srcs-32/ldns && \
$(INSTALL) -d $(abs_builddir)/libs-built-32/windows/x86/ldns && \
$(INSTALL) -m 644 ldns/config.h $(abs_builddir)/libs-built-32/windows/x86/ldns/config.h && \
$(INSTALL) -m 644 ldns/net.h $(abs_builddir)/libs-built-32/windows/x86/ldns/net.h)
$(INSTALL) -d $(abs_builddir)/libs-built-32/windows/ldns && \
$(INSTALL) -m 644 ldns/config.h $(abs_builddir)/libs-built-32/windows/ldns/config.h && \
$(INSTALL) -m 644 ldns/net.h $(abs_builddir)/libs-built-32/windows/ldns/net.h)
COPY_HEADERS_CMD_64 = \
(cd libs-srcs-64/ldns && \
$(INSTALL) -d $(abs_builddir)/libs-built-64/windows/ldns && \
$(INSTALL) -m 644 ldns/config.h $(abs_builddir)/libs-built-64/windows/ldns/config.h && \
$(INSTALL) -m 644 ldns/net.h $(abs_builddir)/libs-built-64/windows/ldns/net.h)
endif
# Linker from mingw-w64 has problems passing the linktest of ldns-1.6.17
# because the libraries are passed in wrong order and -lcrypt32 missing
# completelly. (Parameter -lldns should be used first and -lcrypt32 should be
# added.)
built-ldns-32-stamp: srcs-ldns-32-stamp libs-built-32-stamp built-openssl-32-stamp
-rm -rf libs-built-32/ldns
$(INSTALL) -d libs-built-32/ldns
......@@ -124,7 +154,8 @@ built-ldns-32-stamp: srcs-ldns-32-stamp libs-built-32-stamp built-openssl-32-sta
--with-ssl="$(abs_builddir)/libs-built-32/openssl" \
--disable-ldns-config --without-pyldnsx \
--with-pic --prefix="$(abs_builddir)/libs-built-32/ldns" $(CONFIGURE_ARGS) && \
CFLAGS="$(CFLAGS)" $(MAKE) && $(MAKE) install-h install-lib && \
CFLAGS="$(CFLAGS)" $(MAKE) lib && $(MAKE) install-h install-lib; \
CFLAGS="$(CFLAGS)" $(MAKE) linktest >_linktest.txt 2>&1 || cat _linktest.txt; \
$(MAKE) clean)
$(COPY_HEADERS_CMD_32)
touch $@
......@@ -137,7 +168,8 @@ built-ldns-64-stamp: srcs-ldns-64-stamp libs-built-64-stamp built-openssl-64-sta
--with-ssl="$(abs_builddir)/libs-built-64/openssl" \
--disable-ldns-config --without-pyldnsx \
--with-pic --prefix="$(abs_builddir)/libs-built-64/ldns" $(CONFIGURE_ARGS) && \
CFLAGS="$(CFLAGS)" $(MAKE) && $(MAKE) install-h install-lib && \
CFLAGS="$(CFLAGS)" $(MAKE) lib && $(MAKE) install-h install-lib && \
CFLAGS="$(CFLAGS)" $(MAKE) linktest >_linktest.txt 2>&1 || cat _linktest.txt; \
$(MAKE) clean)
$(COPY_HEADERS_CMD_64)
touch $@
......
--- 001/util/locks.c 2015-11-18 15:11:46.000000000 +0100
+++ 002/util/locks.c 2016-08-22 11:42:57.000000000 +0200
@@ -42,6 +42,7 @@
#include "config.h"
#include "util/locks.h"
#include <signal.h>
+#include "unbound-mingw-w64-compat.h"
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#include <sys/types.h>
#ifdef _WIN64
//__MINGW_EXTENSION
typedef unsigned long long _sigset_t;
#else
typedef unsigned long _sigset_t;
#endif
typedef _sigset_t sigset_t;
#ifndef sigemptyset
# define sigemptyset(pset) (*(pset) = 0)
#endif
#ifndef sigfillset
# define sigfillset(pset) (*(pset) = (_sigset_t)-1)
#endif
#ifndef sigaddset
# define sigaddset(pset, num) (*(pset) |= (1L<<(num)))
#endif
#ifndef sigdelset
# define sigdelset(pset, num) (*(pset) &= ~(1L<<(num)))
#endif
#ifndef sigismember
# define sigismember(pset, num) (*(pset) & (1L<<(num)))
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment