From 2e931c9bcad524df6dea53308b96d832367a0cb4 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Tue, 17 Oct 2023 12:40:08 -0400 Subject: [PATCH] Fix Windows builds (Issue #801) --- cups/globals.c | 4 ++-- cups/json.c | 1 + cups/libcups2.def | 3 +-- cups/string-private.h | 2 +- tools/ipptool.c | 1 + vcnet/libcups2.vcxproj | 2 +- vcnet/libcups2.vcxproj.filters | 41 ++++++++++++++++++++++++++++++---- 7 files changed, 44 insertions(+), 10 deletions(-) diff --git a/cups/globals.c b/cups/globals.c index 41fd595d5f..cf036da37e 100644 --- a/cups/globals.c +++ b/cups/globals.c @@ -137,7 +137,7 @@ DllMain(HINSTANCE hinst, /* I - DLL module handle */ switch (reason) { case DLL_PROCESS_ATTACH : /* Called on library initialization */ - InitializeCriticalSection(&cups_global_mutex.m_criticalSection); + cupsMutexInit(&cups_global_mutex); if ((cups_globals_key = TlsAlloc()) == TLS_OUT_OF_INDEXES) return (FALSE); @@ -153,7 +153,7 @@ DllMain(HINSTANCE hinst, /* I - DLL module handle */ cups_globals_free(cg); TlsFree(cups_globals_key); - DeleteCriticalSection(&cups_global_mutex.m_criticalSection); + cupsMutexDestroy(&cups_global_mutex); break; default: diff --git a/cups/json.c b/cups/json.c index a803d7403a..23ff1fb8b8 100644 --- a/cups/json.c +++ b/cups/json.c @@ -10,6 +10,7 @@ #include "cups-private.h" #include "json-private.h" #include +#include // diff --git a/cups/libcups2.def b/cups/libcups2.def index 52681e00a0..48b2475dd8 100644 --- a/cups/libcups2.def +++ b/cups/libcups2.def @@ -61,12 +61,10 @@ _cups_cupsConcatString _cups_cupsCopyString _cups_gettimeofday _cups_safe_vsnprintf -_cups_snprintf _cups_strcasecmp _cups_strcpy _cups_strcpy _cups_strncasecmp -_cups_vsnprintf _httpCreateCredentials _httpDecodeURI _httpDisconnect @@ -229,6 +227,7 @@ cupsFileGetChar cupsFileGetConf cupsFileGetLine cupsFileGets +cupsFileIsCompressed cupsFileLock cupsFileNumber cupsFileOpen diff --git a/cups/string-private.h b/cups/string-private.h index fc21ff01f0..562c7238c6 100644 --- a/cups/string-private.h +++ b/cups/string-private.h @@ -11,7 +11,7 @@ #ifndef _CUPS_STRING_PRIVATE_H_ # define _CUPS_STRING_PRIVATE_H_ -# include "config.h" +# include # include # include # include diff --git a/tools/ipptool.c b/tools/ipptool.c index f485b457e7..79446aa5af 100644 --- a/tools/ipptool.c +++ b/tools/ipptool.c @@ -18,6 +18,7 @@ #include #include #include +#include #ifdef _WIN32 # include # ifndef R_OK diff --git a/vcnet/libcups2.vcxproj b/vcnet/libcups2.vcxproj index 05b2b6349c..01e6db5ab6 100644 --- a/vcnet/libcups2.vcxproj +++ b/vcnet/libcups2.vcxproj @@ -175,6 +175,7 @@ + @@ -205,7 +206,6 @@ - diff --git a/vcnet/libcups2.vcxproj.filters b/vcnet/libcups2.vcxproj.filters index f2c07a9f66..6744f23874 100644 --- a/vcnet/libcups2.vcxproj.filters +++ b/vcnet/libcups2.vcxproj.filters @@ -174,7 +174,19 @@ Source Files - + + Source Files + + + Source Files + + + Source Files + + + Source Files + + Source Files @@ -254,9 +266,6 @@ Header Files - - Header Files - Header Files @@ -266,5 +275,29 @@ Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + \ No newline at end of file