diff --git a/Makefile.msvc b/Makefile.msvc index c89454ec..f6e8f4e7 100644 --- a/Makefile.msvc +++ b/Makefile.msvc @@ -229,7 +229,7 @@ LINK_CMD_EXE_DBG = $(LINK_CMD_EXE) /debug $(PDBTYPE_CONSOLIDATE) CARES_TARGET = $(STA_LIB_REL).lib CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB CARES_LFLAGS = -SPROG_CFLAGS = /DCARES_STATICLIB +SPROG_CFLAGS = /DCARES_STATICLIB /DCARES_NO_DEPRECATED SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_REL) $(STA_LIB_REL).lib CARES_LINK = $(LINK_CMD_LIB) SPROG_LINK = $(LINK_CMD_EXE_REL) @@ -240,7 +240,7 @@ CC_CMD = $(CC_CMD_REL) CARES_TARGET = $(STA_LIB_DBG).lib CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB /DDEBUGBUILD CARES_LFLAGS = -SPROG_CFLAGS = /DCARES_STATICLIB +SPROG_CFLAGS = /DCARES_STATICLIB /DCARES_NO_DEPRECATED SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_DBG) $(STA_LIB_DBG).lib CARES_LINK = $(LINK_CMD_LIB) SPROG_LINK = $(LINK_CMD_EXE_DBG) @@ -251,7 +251,7 @@ CC_CMD = $(CC_CMD_DBG) CARES_TARGET = $(DYN_LIB_REL).dll CARES_CFLAGS = /DCARES_BUILDING_LIBRARY CARES_LFLAGS = /release $(EX_LIBS_REL) /implib:$(CARES_OUTDIR)\$(IMP_LIB_REL).lib $(PDB_NONE) -SPROG_CFLAGS = +SPROG_CFLAGS = /DCARES_NO_DEPRECATED SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_REL) $(IMP_LIB_REL).lib CARES_LINK = $(LINK_CMD_DLL) SPROG_LINK = $(LINK_CMD_EXE_REL) @@ -264,7 +264,7 @@ RC_CMD = $(RC_CMD_REL) CARES_TARGET = $(DYN_LIB_DBG).dll CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DDEBUGBUILD CARES_LFLAGS = /debug $(EX_LIBS_DBG) /implib:$(CARES_OUTDIR)\$(IMP_LIB_DBG).lib /pdb:$(CARES_OUTDIR)\$(DYN_LIB_DBG).pdb $(PDBTYPE_CONSOLIDATE) -SPROG_CFLAGS = +SPROG_CFLAGS = /DCARES_NO_DEPRECATED SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_DBG) $(IMP_LIB_DBG).lib CARES_LINK = $(LINK_CMD_DLL) SPROG_LINK = $(LINK_CMD_EXE_DBG) diff --git a/include/ares.h b/include/ares.h index 04889b78..49d7a569 100644 --- a/include/ares.h +++ b/include/ares.h @@ -119,6 +119,37 @@ extern "C" { # endif #endif +#ifdef __GNUC__ +#define CARES_GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) +#else +#define CARES_GCC_VERSION 0 +#endif + +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif + +#ifdef CARES_NO_DEPRECATED +#define CARES_DEPRECATED +#define CARES_DEPRECATED_FOR(f) +#else +#if CARES_GCC_VERSION >= 30200 || __has_attribute (__deprecated__) +#define CARES_DEPRECATED __attribute__((__deprecated__)) +#else +#define CARES_DEPRECATED +#endif + +#if CARES_GCC_VERSION >= 40500 || defined(__clang__) +#define CARES_DEPRECATED_FOR(f) __attribute__((deprecated("Use " #f " instead"))) +#elif defined(_MSC_VER) +#define CARES_DEPRECATED_FOR(f) __declspec(deprecated("Use " #f " instead")) +#else +#define CARES_DEPRECATED_FOR(f) CARES_DEPRECATED +#endif +#endif + typedef enum { ARES_SUCCESS = 0, @@ -418,7 +449,8 @@ CARES_EXTERN void ares_library_cleanup(void); CARES_EXTERN const char *ares_version(int *version); -CARES_EXTERN int ares_init(ares_channel_t **channelptr); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_init_options) + int ares_init(ares_channel_t **channelptr); CARES_EXTERN int ares_init_options(ares_channel_t **channelptr, const struct ares_options *options, @@ -494,8 +526,9 @@ CARES_EXTERN void const struct ares_socket_functions *funcs, void *user_data); -CARES_EXTERN void ares_send(ares_channel_t *channel, const unsigned char *qbuf, - int qlen, ares_callback callback, void *arg); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_send_dnsrec) + void ares_send(ares_channel_t *channel, const unsigned char *qbuf, + int qlen, ares_callback callback, void *arg); /*! Send a DNS query as an ares_dns_record_t with a callback containing the * parsed DNS record. @@ -513,9 +546,10 @@ CARES_EXTERN ares_status_t ares_send_dnsrec(ares_channel_t *channel, ares_callback_dnsrec callback, void *arg, unsigned short *qid); -CARES_EXTERN void ares_query(ares_channel_t *channel, const char *name, - int dnsclass, int type, ares_callback callback, - void *arg); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_query_dnsrec) + void ares_query(ares_channel_t *channel, const char *name, + int dnsclass, int type, ares_callback callback, + void *arg); /*! Perform a DNS query with a callback containing the parsed DNS record. * @@ -537,9 +571,10 @@ CARES_EXTERN ares_status_t ares_query_dnsrec(ares_channel_t *channel, void *arg, unsigned short *qid); -CARES_EXTERN void ares_search(ares_channel_t *channel, const char *name, - int dnsclass, int type, ares_callback callback, - void *arg); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_search_dnsrec) + void ares_search(ares_channel_t *channel, const char *name, + int dnsclass, int type, ares_callback callback, + void *arg); /*! Search for a complete DNS message. * @@ -557,9 +592,10 @@ CARES_EXTERN ares_status_t ares_search_dnsrec(ares_channel_t *channel, ares_callback_dnsrec callback, void *arg); -CARES_EXTERN void ares_gethostbyname(ares_channel_t *channel, const char *name, - int family, ares_host_callback callback, - void *arg); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_getaddrinfo) + void ares_gethostbyname(ares_channel_t *channel, const char *name, + int family, ares_host_callback callback, + void *arg); CARES_EXTERN int ares_gethostbyname_file(ares_channel_t *channel, const char *name, int family, @@ -574,31 +610,34 @@ CARES_EXTERN void ares_getnameinfo(ares_channel_t *channel, ares_socklen_t salen, int flags, ares_nameinfo_callback callback, void *arg); -CARES_EXTERN int ares_fds(ares_channel_t *channel, fd_set *read_fds, - fd_set *write_fds); +CARES_EXTERN CARES_DEPRECATED_FOR(ARES_OPT_EVENT_THREAD or ARES_OPT_SOCK_STATE_CB) + int ares_fds(ares_channel_t *channel, fd_set *read_fds, fd_set *write_fds); -CARES_EXTERN int ares_getsock(ares_channel_t *channel, ares_socket_t *socks, - int numsocks); +CARES_EXTERN CARES_DEPRECATED_FOR(ARES_OPT_EVENT_THREAD or ARES_OPT_SOCK_STATE_CB) + int ares_getsock(ares_channel_t *channel, ares_socket_t *socks, int numsocks); CARES_EXTERN struct timeval *ares_timeout(ares_channel_t *channel, struct timeval *maxtv, struct timeval *tv); -CARES_EXTERN void ares_process(ares_channel_t *channel, fd_set *read_fds, - fd_set *write_fds); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_process_fd) + void ares_process(ares_channel_t *channel, fd_set *read_fds, + fd_set *write_fds); CARES_EXTERN void ares_process_fd(ares_channel_t *channel, ares_socket_t read_fd, ares_socket_t write_fd); -CARES_EXTERN int ares_create_query(const char *name, int dnsclass, int type, - unsigned short id, int rd, - unsigned char **buf, int *buflen, - int max_udp_size); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_record_create) + int ares_create_query(const char *name, int dnsclass, int type, + unsigned short id, int rd, + unsigned char **buf, int *buflen, + int max_udp_size); -CARES_EXTERN int ares_mkquery(const char *name, int dnsclass, int type, - unsigned short id, int rd, unsigned char **buf, - int *buflen); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_record_create) + int ares_mkquery(const char *name, int dnsclass, int type, + unsigned short id, int rd, unsigned char **buf, + int *buflen); CARES_EXTERN int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf, int alen, char **s, @@ -733,46 +772,58 @@ struct ares_addrinfo_hints { ** so written. */ -CARES_EXTERN int ares_parse_a_reply(const unsigned char *abuf, int alen, - struct hostent **host, - struct ares_addrttl *addrttls, - int *naddrttls); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse) + int ares_parse_a_reply(const unsigned char *abuf, int alen, + struct hostent **host, + struct ares_addrttl *addrttls, + int *naddrttls); -CARES_EXTERN int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, - struct hostent **host, - struct ares_addr6ttl *addrttls, - int *naddrttls); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse) + int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, + struct hostent **host, + struct ares_addr6ttl *addrttls, + int *naddrttls); -CARES_EXTERN int ares_parse_caa_reply(const unsigned char *abuf, int alen, - struct ares_caa_reply **caa_out); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse) + int ares_parse_caa_reply(const unsigned char *abuf, int alen, + struct ares_caa_reply **caa_out); -CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf, int alen, - const void *addr, int addrlen, int family, - struct hostent **host); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse) + int ares_parse_ptr_reply(const unsigned char *abuf, int alen, + const void *addr, int addrlen, int family, + struct hostent **host); -CARES_EXTERN int ares_parse_ns_reply(const unsigned char *abuf, int alen, - struct hostent **host); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse) + int ares_parse_ns_reply(const unsigned char *abuf, int alen, + struct hostent **host); -CARES_EXTERN int ares_parse_srv_reply(const unsigned char *abuf, int alen, - struct ares_srv_reply **srv_out); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse) + int ares_parse_srv_reply(const unsigned char *abuf, int alen, + struct ares_srv_reply **srv_out); -CARES_EXTERN int ares_parse_mx_reply(const unsigned char *abuf, int alen, - struct ares_mx_reply **mx_out); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse) + int ares_parse_mx_reply(const unsigned char *abuf, int alen, + struct ares_mx_reply **mx_out); -CARES_EXTERN int ares_parse_txt_reply(const unsigned char *abuf, int alen, - struct ares_txt_reply **txt_out); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse) + int ares_parse_txt_reply(const unsigned char *abuf, int alen, + struct ares_txt_reply **txt_out); -CARES_EXTERN int ares_parse_txt_reply_ext(const unsigned char *abuf, int alen, - struct ares_txt_ext **txt_out); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse) + int ares_parse_txt_reply_ext(const unsigned char *abuf, int alen, + struct ares_txt_ext **txt_out); -CARES_EXTERN int ares_parse_naptr_reply(const unsigned char *abuf, int alen, - struct ares_naptr_reply **naptr_out); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse) + int ares_parse_naptr_reply(const unsigned char *abuf, int alen, + struct ares_naptr_reply **naptr_out); -CARES_EXTERN int ares_parse_soa_reply(const unsigned char *abuf, int alen, - struct ares_soa_reply **soa_out); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse) + int ares_parse_soa_reply(const unsigned char *abuf, int alen, + struct ares_soa_reply **soa_out); -CARES_EXTERN int ares_parse_uri_reply(const unsigned char *abuf, int alen, - struct ares_uri_reply **uri_out); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse) + int ares_parse_uri_reply(const unsigned char *abuf, int alen, + struct ares_uri_reply **uri_out); CARES_EXTERN void ares_free_string(void *str); @@ -805,11 +856,13 @@ struct ares_addr_port_node { int tcp_port; }; -CARES_EXTERN int ares_set_servers(ares_channel_t *channel, - const struct ares_addr_node *servers); -CARES_EXTERN int - ares_set_servers_ports(ares_channel_t *channel, - const struct ares_addr_port_node *servers); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_set_servers_csv) + int ares_set_servers(ares_channel_t *channel, + const struct ares_addr_node *servers); + +CARES_EXTERN CARES_DEPRECATED_FOR(ares_set_servers_ports_csv) + int ares_set_servers_ports(ares_channel_t *channel, + const struct ares_addr_port_node *servers); /* Incoming string format: host[:port][,host[:port]]... */ CARES_EXTERN int ares_set_servers_csv(ares_channel_t *channel, @@ -818,10 +871,13 @@ CARES_EXTERN int ares_set_servers_ports_csv(ares_channel_t *channel, const char *servers); CARES_EXTERN char *ares_get_servers_csv(ares_channel_t *channel); -CARES_EXTERN int ares_get_servers(ares_channel_t *channel, - struct ares_addr_node **servers); -CARES_EXTERN int ares_get_servers_ports(ares_channel_t *channel, - struct ares_addr_port_node **servers); +CARES_EXTERN CARES_DEPRECATED_FOR(ares_get_servers_csv) + int ares_get_servers(ares_channel_t *channel, + struct ares_addr_node **servers); + +CARES_EXTERN CARES_DEPRECATED_FOR(ares_get_servers_ports_csv) + int ares_get_servers_ports(ares_channel_t *channel, + struct ares_addr_port_node **servers); CARES_EXTERN const char *ares_inet_ntop(int af, const void *src, char *dst, ares_socklen_t size); diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index dec0d895..38f7a115 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -49,7 +49,6 @@ CSOURCES = ares__addrinfo2hostent.c \ ares_init.c \ ares_library_init.c \ ares_math.c \ - ares_mkquery.c \ ares_create_query.c \ ares_options.c \ ares_parse_a_reply.c \ diff --git a/src/lib/ares_create_query.c b/src/lib/ares_create_query.c index 51470e90..f0a05213 100644 --- a/src/lib/ares_create_query.c +++ b/src/lib/ares_create_query.c @@ -28,9 +28,10 @@ #include "ares.h" #include "ares_private.h" -int ares_create_query(const char *name, int dnsclass, int type, - unsigned short id, int rd, unsigned char **bufp, - int *buflenp, int max_udp_size) +static int ares_create_query_int(const char *name, int dnsclass, int type, + unsigned short id, int rd, + unsigned char **bufp, int *buflenp, + int max_udp_size) { ares_status_t status; ares_dns_record_t *dnsrec = NULL; @@ -64,3 +65,18 @@ done: ares_dns_record_destroy(dnsrec); return (int)status; } + +int ares_create_query(const char *name, int dnsclass, int type, + unsigned short id, int rd, unsigned char **bufp, + int *buflenp, int max_udp_size) +{ + return ares_create_query_int(name, dnsclass, type, id, rd, bufp, buflenp, + max_udp_size); +} + +int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id, + int rd, unsigned char **buf, int *buflen) +{ + return ares_create_query_int(name, dnsclass, type, id, rd, buf, buflen, 0); +} + diff --git a/src/lib/ares_mkquery.c b/src/lib/ares_mkquery.c deleted file mode 100644 index da1898e7..00000000 --- a/src/lib/ares_mkquery.c +++ /dev/null @@ -1,35 +0,0 @@ -/* MIT License - * - * Copyright (c) 1998 Massachusetts Institute of Technology - * Copyright (c) The c-ares project and its contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * SPDX-License-Identifier: MIT - */ - -#include "ares_setup.h" -#include "ares.h" - -int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id, - int rd, unsigned char **buf, int *buflen) -{ - return ares_create_query(name, dnsclass, type, id, rd, buf, buflen, 0); -} diff --git a/src/lib/ares_update_servers.c b/src/lib/ares_update_servers.c index 9f9a4dfa..5e811bae 100644 --- a/src/lib/ares_update_servers.c +++ b/src/lib/ares_update_servers.c @@ -1080,7 +1080,7 @@ static ares_status_t set_servers_csv(ares_channel_t *channel, const char *_csv) if (ares_strlen(_csv) == 0) { /* blank all servers */ - return (ares_status_t)ares_set_servers_ports(channel, NULL); + return ares__servers_update(channel, NULL, ARES_TRUE); } status = ares__sconfig_append_fromstr(&slist, _csv, ARES_FALSE); diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 13aefe13..fb795a91 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -19,7 +19,7 @@ IF (CARES_BUILD_TOOLS) C_STANDARD 90 ) - TARGET_COMPILE_DEFINITIONS (ahost PRIVATE HAVE_CONFIG_H=1) + TARGET_COMPILE_DEFINITIONS (ahost PRIVATE HAVE_CONFIG_H=1 CARES_NO_DEPRECATED) TARGET_LINK_LIBRARIES (ahost PRIVATE ${PROJECT_NAME}) IF (CARES_INSTALL) INSTALL (TARGETS ahost COMPONENT Tools ${TARGETS_INST_DEST}) @@ -40,7 +40,7 @@ IF (CARES_BUILD_TOOLS) C_STANDARD 90 ) - TARGET_COMPILE_DEFINITIONS (adig PRIVATE HAVE_CONFIG_H=1) + TARGET_COMPILE_DEFINITIONS (adig PRIVATE HAVE_CONFIG_H=1 CARES_NO_DEPRECATED) TARGET_LINK_LIBRARIES (adig PRIVATE ${PROJECT_NAME}) IF (CARES_INSTALL) INSTALL (TARGETS adig COMPONENT Tools ${TARGETS_INST_DEST}) diff --git a/src/tools/Makefile.am b/src/tools/Makefile.am index 729658d7..ba7a672f 100644 --- a/src/tools/Makefile.am +++ b/src/tools/Makefile.am @@ -15,7 +15,8 @@ noinst_PROGRAMS =$(PROGS) AM_CPPFLAGS += -I$(top_builddir)/include \ -I$(top_builddir)/src/lib \ -I$(top_srcdir)/include \ - -I$(top_srcdir)/src/lib + -I$(top_srcdir)/src/lib \ + -DCARES_NO_DEPRECATED include Makefile.inc diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b69b9db0..fbb6a621 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -38,17 +38,22 @@ add_executable(arestest ${TESTSOURCES} ${TESTHEADERS}) target_include_directories(arestest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(arestest PRIVATE caresinternal GTest::gmock) +target_compile_definitions(arestest PRIVATE CARES_NO_DEPRECATED) + IF (CARES_BUILD_CONTAINER_TESTS) target_compile_definitions(arestest PRIVATE HAVE_USER_NAMESPACE HAVE_UTS_NAMESPACE) ENDIF () add_executable(aresfuzz ${FUZZSOURCES}) +target_compile_definitions(aresfuzz PRIVATE CARES_NO_DEPRECATED) target_link_libraries(aresfuzz PRIVATE caresinternal) add_executable(aresfuzzname ${FUZZNAMESOURCES}) +target_compile_definitions(aresfuzzname PRIVATE CARES_NO_DEPRECATED) target_link_libraries(aresfuzzname PRIVATE caresinternal) add_executable(dnsdump ${DUMPSOURCES}) +target_compile_definitions(dnsdump PRIVATE CARES_NO_DEPRECATED) target_link_libraries(dnsdump PRIVATE caresinternal) # register tests diff --git a/test/Makefile.am b/test/Makefile.am index 62d421aa..8ebcd851 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -8,7 +8,7 @@ AM_CPPFLAGS += -I$(top_builddir)/include \ -I$(top_srcdir)/src/lib \ -I$(top_srcdir)/test \ -I$(top_builddir)/test \ - -I$(top_builddir) + -I$(top_builddir) -DCARES_NO_DEPRECATED AM_CXXFLAGS := AM_CXXFLAGS += $(PTHREAD_CFLAGS) diff --git a/test/Makefile.m32 b/test/Makefile.m32 index c8995eee..326ac67f 100644 --- a/test/Makefile.m32 +++ b/test/Makefile.m32 @@ -19,7 +19,7 @@ ARES_SRC_DIR = .. # Where to find the built c-ares static library ARES_BLD_DIR = .. ARESLIB = $(ARES_BLD_DIR)/src/lib/libcares.a -CPPFLAGS = -I$(ARES_SRC_DIR)/include -I$(ARES_SRC_DIR)/src/lib -I$(GTEST_ROOT)/include -DCARES_STATICLIB +CPPFLAGS = -I$(ARES_SRC_DIR)/include -I$(ARES_SRC_DIR)/src/lib -I$(GTEST_ROOT)/include -DCARES_STATICLIB -DCARES_NO_DEPRECATED CXXFLAGS = -Wall $(PTHREAD_CFLAGS) -std=gnu++14 LDFLAGS = LDLIBS = -lws2_32 -liphlpapi diff --git a/test/Makefile.msvc b/test/Makefile.msvc index a6587b0d..bb2648c2 100644 --- a/test/Makefile.msvc +++ b/test/Makefile.msvc @@ -192,7 +192,7 @@ LINK_CMD_EXE_DBG = $(LINK_CMD_EXE) /debug $(PDBTYPE_CONSOLIDATE) CARES_TARGET = $(STA_LIB_REL).lib CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB CARES_LFLAGS = -SPROG_CFLAGS = /DCARES_STATICLIB +SPROG_CFLAGS = /DCARES_STATICLIB /DCARES_NO_DEPRECATED SPROG_LFLAGS = /libpath:$(LIB_OUTDIR) $(EX_LIBS_REL) $(STA_LIB_REL).lib CARES_LINK = $(LINK_CMD_LIB) SPROG_LINK = $(LINK_CMD_EXE_REL) @@ -203,7 +203,7 @@ CC_CMD = $(CC_CMD_REL) CARES_TARGET = $(STA_LIB_DBG).lib CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB /DDEBUGBUILD CARES_LFLAGS = -SPROG_CFLAGS = /DCARES_STATICLIB +SPROG_CFLAGS = /DCARES_STATICLIB /DCARES_NO_DEPRECATED SPROG_LFLAGS = /libpath:$(LIB_OUTDIR) $(EX_LIBS_DBG) $(STA_LIB_DBG).lib CARES_LINK = $(LINK_CMD_LIB) SPROG_LINK = $(LINK_CMD_EXE_DBG) @@ -214,7 +214,7 @@ CC_CMD = $(CC_CMD_DBG) CARES_TARGET = $(DYN_LIB_REL).dll CARES_CFLAGS = /DCARES_BUILDING_LIBRARY CARES_LFLAGS = /release $(EX_LIBS_REL) /implib:$(PROG_OUTDIR)\$(IMP_LIB_REL).lib $(PDB_NONE) -SPROG_CFLAGS = +SPROG_CFLAGS = /DCARES_NO_DEPRECATED SPROG_LFLAGS = /libpath:$(LIB_OUTDIR) $(EX_LIBS_REL) $(IMP_LIB_REL).lib CARES_LINK = $(LINK_CMD_DLL) SPROG_LINK = $(LINK_CMD_EXE_REL) @@ -227,7 +227,7 @@ RC_CMD = $(RC_CMD_REL) CARES_TARGET = $(DYN_LIB_DBG).dll CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DDEBUGBUILD CARES_LFLAGS = /debug $(EX_LIBS_DBG) /implib:$(PROG_OUTDIR)\$(IMP_LIB_DBG).lib /pdb:$(PROG_OUTDIR)\$(DYN_LIB_DBG).pdb $(PDBTYPE_CONSOLIDATE) -SPROG_CFLAGS = +SPROG_CFLAGS = /DCARES_NO_DEPRECATED SPROG_LFLAGS = /libpath:$(LIB_OUTDIR) $(EX_LIBS_DBG) $(IMP_LIB_DBG).lib CARES_LINK = $(LINK_CMD_DLL) SPROG_LINK = $(LINK_CMD_EXE_DBG)