Skip to content

Commit

Permalink
win: build with WIN32_LEAN_AND_MEAN macro defined globally
Browse files Browse the repository at this point in the history
  • Loading branch information
sergio-nsk committed Aug 14, 2024
1 parent 6bc5050 commit f96f0e5
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 7 deletions.
15 changes: 8 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,14 @@ endif()

if(WIN32)
add_compile_definitions(
_CRT_SECURE_NO_WARNINGS=1
_CRT_NONSTDC_NO_WARNINGS=1
_WINSOCK_DEPRECATED_NO_WARNINGS=1
COBJMACROS)
_CRT_SECURE_NO_WARNINGS
_CRT_NONSTDC_NO_WARNINGS
_WINSOCK_DEPRECATED_NO_WARNINGS
COBJMACROS
WIN32_LEAN_AND_MEAN)
elseif(APPLE)
elseif(UNIX)
add_compile_definitions(_GNU_SOURCE=1)
add_compile_definitions(_GNU_SOURCE)
endif()

add_compile_definitions($<IF:$<CONFIG:Debug>,_DEBUG,_NDEBUG>)
Expand Down Expand Up @@ -252,10 +253,10 @@ if(PROXYRES_CURL AND (PROXYRES_EXECUTE OR PROXYRES_BUILD_CLI))
endif()

if(PROXYRES_EXECUTE)
target_compile_definitions(proxyres PUBLIC PROXYRES_EXECUTE=1)
target_compile_definitions(proxyres PUBLIC PROXYRES_EXECUTE)

if(TARGET CURL::libcurl)
target_compile_definitions(proxyres PUBLIC HAVE_CURL=1)
target_compile_definitions(proxyres PUBLIC HAVE_CURL)
target_sources(proxyres PRIVATE fetch_curl.c)
target_link_libraries(proxyres CURL::libcurl)
else()
Expand Down
1 change: 1 addition & 0 deletions config_win.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>

#include <windows.h>
#include <wininet.h>
Expand Down
1 change: 1 addition & 0 deletions execute_wsh.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <initguid.h>
#include <activscp.h>
#include <activdbg.h>
#include <cguid.h>

#include "execute.h"
#include "execute_i.h"
Expand Down
1 change: 1 addition & 0 deletions resolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <errno.h>
#ifdef _WIN32
# include <windows.h>
# include <winsock2.h>
#endif

#include "config.h"
Expand Down
1 change: 1 addition & 0 deletions resolver_win8.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>

#include <windows.h>
Expand Down
1 change: 1 addition & 0 deletions resolver_winxp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <inttypes.h>

#include <windows.h>
Expand Down
1 change: 1 addition & 0 deletions threadpool_winvista.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>

#include <windows.h>
Expand Down
1 change: 1 addition & 0 deletions util_win.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <wchar.h>

#include <windows.h>
Expand Down
1 change: 1 addition & 0 deletions wpad_dhcp_win.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>

#include <windows.h>
#include <dhcpcsdk.h>
Expand Down

0 comments on commit f96f0e5

Please sign in to comment.