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

win: build with WIN32_LEAN_AND_MEAN macro defined globally #62

Merged
merged 2 commits into from
Aug 14, 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
4 changes: 2 additions & 2 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ jobs:
- name: Generate coverage report
if: always() && matrix.codecov
run: |
python3 -u -m pip install --user gcovr
python3 -m gcovr \
brew install gcovr
gcovr \
--exclude-unreachable-branches \
--gcov-ignore-parse-errors \
--root . \
Expand Down
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
Loading