Skip to content

Commit

Permalink
Fix Windows builds (Issue #801)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Oct 17, 2023
1 parent 9f177b7 commit 2e931c9
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 10 deletions.
4 changes: 2 additions & 2 deletions cups/globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions cups/json.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "cups-private.h"
#include "json-private.h"
#include <sys/stat.h>
#include <fcntl.h>


//
Expand Down
3 changes: 1 addition & 2 deletions cups/libcups2.def
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -229,6 +227,7 @@ cupsFileGetChar
cupsFileGetConf
cupsFileGetLine
cupsFileGets
cupsFileIsCompressed
cupsFileLock
cupsFileNumber
cupsFileOpen
Expand Down
2 changes: 1 addition & 1 deletion cups/string-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#ifndef _CUPS_STRING_PRIVATE_H_
# define _CUPS_STRING_PRIVATE_H_
# include "config.h"
# include <config.h>
# include <stdio.h>
# include <stdlib.h>
# include <stdarg.h>
Expand Down
1 change: 1 addition & 0 deletions tools/ipptool.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <cups/raster-testpage.h>
#include <regex.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifdef _WIN32
# include <windows.h>
# ifndef R_OK
Expand Down
2 changes: 1 addition & 1 deletion vcnet/libcups2.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
<ItemGroup>
<ClInclude Include="..\cups\adminutil.h" />
<ClInclude Include="..\cups\array.h" />
<ClInclude Include="..\cups\base.h" />
<ClInclude Include="..\cups\cups-private.h" />
<ClInclude Include="..\cups\cups.h" />
<ClInclude Include="..\cups\debug-internal.h" />
Expand Down Expand Up @@ -205,7 +206,6 @@
<ClInclude Include="..\cups\string-private.h" />
<ClInclude Include="..\cups\thread.h" />
<ClInclude Include="..\cups\transcode.h" />
<ClInclude Include="..\cups\versioning.h" />
<ClInclude Include="config.h" />
</ItemGroup>
<ItemGroup>
Expand Down
41 changes: 37 additions & 4 deletions vcnet/libcups2.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,19 @@
<ClCompile Include="..\cups\ipp-file.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\cups\ipp-vars.c">
<ClCompile Include="..\cups\dnssd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\cups\form.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\cups\json.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\cups\jwt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\cups\rand.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
Expand Down Expand Up @@ -254,9 +266,6 @@
<ClInclude Include="..\cups\raster-private.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\cups\versioning.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\cups\language-private.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand All @@ -266,5 +275,29 @@
<ClInclude Include="..\cups\pwg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\cups\dnssd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\cups\form.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\cups\json.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\cups\json-private.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\cups\jwt.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\cups\raster-testpage.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\cups\debug-internal.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\cups\base.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

0 comments on commit 2e931c9

Please sign in to comment.