mark deprecated functions as such (#732)

Multiple functions have been deprecated over the years, annotate them
with attribute deprecated.

When possible show a message about their replacements.

This is a continuation/completion of PR #706

Fix By: Cristian Rodríguez (@crrodriguez)
pull/733/head
Brad House 8 months ago committed by GitHub
parent b692328336
commit 5fd3fc3ab3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      Makefile.msvc
  2. 182
      include/ares.h
  3. 1
      src/lib/Makefile.inc
  4. 22
      src/lib/ares_create_query.c
  5. 35
      src/lib/ares_mkquery.c
  6. 2
      src/lib/ares_update_servers.c
  7. 4
      src/tools/CMakeLists.txt
  8. 3
      src/tools/Makefile.am
  9. 5
      test/CMakeLists.txt
  10. 2
      test/Makefile.am
  11. 2
      test/Makefile.m32
  12. 8
      test/Makefile.msvc

@ -229,7 +229,7 @@ LINK_CMD_EXE_DBG = $(LINK_CMD_EXE) /debug $(PDBTYPE_CONSOLIDATE)
CARES_TARGET = $(STA_LIB_REL).lib CARES_TARGET = $(STA_LIB_REL).lib
CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB
CARES_LFLAGS = 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 SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_REL) $(STA_LIB_REL).lib
CARES_LINK = $(LINK_CMD_LIB) CARES_LINK = $(LINK_CMD_LIB)
SPROG_LINK = $(LINK_CMD_EXE_REL) SPROG_LINK = $(LINK_CMD_EXE_REL)
@ -240,7 +240,7 @@ CC_CMD = $(CC_CMD_REL)
CARES_TARGET = $(STA_LIB_DBG).lib CARES_TARGET = $(STA_LIB_DBG).lib
CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB /DDEBUGBUILD CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB /DDEBUGBUILD
CARES_LFLAGS = 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 SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_DBG) $(STA_LIB_DBG).lib
CARES_LINK = $(LINK_CMD_LIB) CARES_LINK = $(LINK_CMD_LIB)
SPROG_LINK = $(LINK_CMD_EXE_DBG) SPROG_LINK = $(LINK_CMD_EXE_DBG)
@ -251,7 +251,7 @@ CC_CMD = $(CC_CMD_DBG)
CARES_TARGET = $(DYN_LIB_REL).dll CARES_TARGET = $(DYN_LIB_REL).dll
CARES_CFLAGS = /DCARES_BUILDING_LIBRARY CARES_CFLAGS = /DCARES_BUILDING_LIBRARY
CARES_LFLAGS = /release $(EX_LIBS_REL) /implib:$(CARES_OUTDIR)\$(IMP_LIB_REL).lib $(PDB_NONE) 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 SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_REL) $(IMP_LIB_REL).lib
CARES_LINK = $(LINK_CMD_DLL) CARES_LINK = $(LINK_CMD_DLL)
SPROG_LINK = $(LINK_CMD_EXE_REL) SPROG_LINK = $(LINK_CMD_EXE_REL)
@ -264,7 +264,7 @@ RC_CMD = $(RC_CMD_REL)
CARES_TARGET = $(DYN_LIB_DBG).dll CARES_TARGET = $(DYN_LIB_DBG).dll
CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DDEBUGBUILD 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) 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 SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_DBG) $(IMP_LIB_DBG).lib
CARES_LINK = $(LINK_CMD_DLL) CARES_LINK = $(LINK_CMD_DLL)
SPROG_LINK = $(LINK_CMD_EXE_DBG) SPROG_LINK = $(LINK_CMD_EXE_DBG)

@ -119,6 +119,37 @@ extern "C" {
# endif # endif
#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 { typedef enum {
ARES_SUCCESS = 0, ARES_SUCCESS = 0,
@ -418,7 +449,8 @@ CARES_EXTERN void ares_library_cleanup(void);
CARES_EXTERN const char *ares_version(int *version); 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, CARES_EXTERN int ares_init_options(ares_channel_t **channelptr,
const struct ares_options *options, const struct ares_options *options,
@ -494,8 +526,9 @@ CARES_EXTERN void
const struct ares_socket_functions *funcs, const struct ares_socket_functions *funcs,
void *user_data); void *user_data);
CARES_EXTERN void ares_send(ares_channel_t *channel, const unsigned char *qbuf, CARES_EXTERN CARES_DEPRECATED_FOR(ares_send_dnsrec)
int qlen, ares_callback callback, void *arg); 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 /*! Send a DNS query as an ares_dns_record_t with a callback containing the
* parsed DNS record. * parsed DNS record.
@ -513,9 +546,10 @@ CARES_EXTERN ares_status_t ares_send_dnsrec(ares_channel_t *channel,
ares_callback_dnsrec callback, ares_callback_dnsrec callback,
void *arg, unsigned short *qid); void *arg, unsigned short *qid);
CARES_EXTERN void ares_query(ares_channel_t *channel, const char *name, CARES_EXTERN CARES_DEPRECATED_FOR(ares_query_dnsrec)
int dnsclass, int type, ares_callback callback, void ares_query(ares_channel_t *channel, const char *name,
void *arg); int dnsclass, int type, ares_callback callback,
void *arg);
/*! Perform a DNS query with a callback containing the parsed DNS record. /*! 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, void *arg,
unsigned short *qid); unsigned short *qid);
CARES_EXTERN void ares_search(ares_channel_t *channel, const char *name, CARES_EXTERN CARES_DEPRECATED_FOR(ares_search_dnsrec)
int dnsclass, int type, ares_callback callback, void ares_search(ares_channel_t *channel, const char *name,
void *arg); int dnsclass, int type, ares_callback callback,
void *arg);
/*! Search for a complete DNS message. /*! 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, ares_callback_dnsrec callback,
void *arg); void *arg);
CARES_EXTERN void ares_gethostbyname(ares_channel_t *channel, const char *name, CARES_EXTERN CARES_DEPRECATED_FOR(ares_getaddrinfo)
int family, ares_host_callback callback, void ares_gethostbyname(ares_channel_t *channel, const char *name,
void *arg); int family, ares_host_callback callback,
void *arg);
CARES_EXTERN int ares_gethostbyname_file(ares_channel_t *channel, CARES_EXTERN int ares_gethostbyname_file(ares_channel_t *channel,
const char *name, int family, 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_socklen_t salen, int flags,
ares_nameinfo_callback callback, void *arg); ares_nameinfo_callback callback, void *arg);
CARES_EXTERN int ares_fds(ares_channel_t *channel, fd_set *read_fds, CARES_EXTERN CARES_DEPRECATED_FOR(ARES_OPT_EVENT_THREAD or ARES_OPT_SOCK_STATE_CB)
fd_set *write_fds); 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, CARES_EXTERN CARES_DEPRECATED_FOR(ARES_OPT_EVENT_THREAD or ARES_OPT_SOCK_STATE_CB)
int numsocks); int ares_getsock(ares_channel_t *channel, ares_socket_t *socks, int numsocks);
CARES_EXTERN struct timeval *ares_timeout(ares_channel_t *channel, CARES_EXTERN struct timeval *ares_timeout(ares_channel_t *channel,
struct timeval *maxtv, struct timeval *maxtv,
struct timeval *tv); struct timeval *tv);
CARES_EXTERN void ares_process(ares_channel_t *channel, fd_set *read_fds, CARES_EXTERN CARES_DEPRECATED_FOR(ares_process_fd)
fd_set *write_fds); 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, CARES_EXTERN void ares_process_fd(ares_channel_t *channel,
ares_socket_t read_fd, ares_socket_t read_fd,
ares_socket_t write_fd); ares_socket_t write_fd);
CARES_EXTERN int ares_create_query(const char *name, int dnsclass, int type, CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_record_create)
unsigned short id, int rd, int ares_create_query(const char *name, int dnsclass, int type,
unsigned char **buf, int *buflen, unsigned short id, int rd,
int max_udp_size); unsigned char **buf, int *buflen,
int max_udp_size);
CARES_EXTERN int ares_mkquery(const char *name, int dnsclass, int type, CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_record_create)
unsigned short id, int rd, unsigned char **buf, int ares_mkquery(const char *name, int dnsclass, int type,
int *buflen); unsigned short id, int rd, unsigned char **buf,
int *buflen);
CARES_EXTERN int ares_expand_name(const unsigned char *encoded, CARES_EXTERN int ares_expand_name(const unsigned char *encoded,
const unsigned char *abuf, int alen, char **s, const unsigned char *abuf, int alen, char **s,
@ -733,46 +772,58 @@ struct ares_addrinfo_hints {
** so written. ** so written.
*/ */
CARES_EXTERN int ares_parse_a_reply(const unsigned char *abuf, int alen, CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse)
struct hostent **host, int ares_parse_a_reply(const unsigned char *abuf, int alen,
struct ares_addrttl *addrttls, struct hostent **host,
int *naddrttls); struct ares_addrttl *addrttls,
int *naddrttls);
CARES_EXTERN int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse)
struct hostent **host, int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
struct ares_addr6ttl *addrttls, struct hostent **host,
int *naddrttls); struct ares_addr6ttl *addrttls,
int *naddrttls);
CARES_EXTERN int ares_parse_caa_reply(const unsigned char *abuf, int alen, CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse)
struct ares_caa_reply **caa_out); 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, CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse)
const void *addr, int addrlen, int family, int ares_parse_ptr_reply(const unsigned char *abuf, int alen,
struct hostent **host); const void *addr, int addrlen, int family,
struct hostent **host);
CARES_EXTERN int ares_parse_ns_reply(const unsigned char *abuf, int alen, CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse)
struct hostent **host); 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, CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse)
struct ares_srv_reply **srv_out); 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, CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse)
struct ares_mx_reply **mx_out); 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, CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse)
struct ares_txt_reply **txt_out); 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, CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse)
struct ares_txt_ext **txt_out); 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, CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse)
struct ares_naptr_reply **naptr_out); 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, CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse)
struct ares_soa_reply **soa_out); 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, CARES_EXTERN CARES_DEPRECATED_FOR(ares_dns_parse)
struct ares_uri_reply **uri_out); 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); CARES_EXTERN void ares_free_string(void *str);
@ -805,11 +856,13 @@ struct ares_addr_port_node {
int tcp_port; int tcp_port;
}; };
CARES_EXTERN int ares_set_servers(ares_channel_t *channel, CARES_EXTERN CARES_DEPRECATED_FOR(ares_set_servers_csv)
const struct ares_addr_node *servers); int ares_set_servers(ares_channel_t *channel,
CARES_EXTERN int const struct ares_addr_node *servers);
ares_set_servers_ports(ares_channel_t *channel,
const struct ares_addr_port_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]]... */ /* Incoming string format: host[:port][,host[:port]]... */
CARES_EXTERN int ares_set_servers_csv(ares_channel_t *channel, 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); const char *servers);
CARES_EXTERN char *ares_get_servers_csv(ares_channel_t *channel); CARES_EXTERN char *ares_get_servers_csv(ares_channel_t *channel);
CARES_EXTERN int ares_get_servers(ares_channel_t *channel, CARES_EXTERN CARES_DEPRECATED_FOR(ares_get_servers_csv)
struct ares_addr_node **servers); int ares_get_servers(ares_channel_t *channel,
CARES_EXTERN int ares_get_servers_ports(ares_channel_t *channel, struct ares_addr_node **servers);
struct ares_addr_port_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, CARES_EXTERN const char *ares_inet_ntop(int af, const void *src, char *dst,
ares_socklen_t size); ares_socklen_t size);

@ -49,7 +49,6 @@ CSOURCES = ares__addrinfo2hostent.c \
ares_init.c \ ares_init.c \
ares_library_init.c \ ares_library_init.c \
ares_math.c \ ares_math.c \
ares_mkquery.c \
ares_create_query.c \ ares_create_query.c \
ares_options.c \ ares_options.c \
ares_parse_a_reply.c \ ares_parse_a_reply.c \

@ -28,9 +28,10 @@
#include "ares.h" #include "ares.h"
#include "ares_private.h" #include "ares_private.h"
int ares_create_query(const char *name, int dnsclass, int type, static int ares_create_query_int(const char *name, int dnsclass, int type,
unsigned short id, int rd, unsigned char **bufp, unsigned short id, int rd,
int *buflenp, int max_udp_size) unsigned char **bufp, int *buflenp,
int max_udp_size)
{ {
ares_status_t status; ares_status_t status;
ares_dns_record_t *dnsrec = NULL; ares_dns_record_t *dnsrec = NULL;
@ -64,3 +65,18 @@ done:
ares_dns_record_destroy(dnsrec); ares_dns_record_destroy(dnsrec);
return (int)status; 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);
}

@ -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);
}

@ -1080,7 +1080,7 @@ static ares_status_t set_servers_csv(ares_channel_t *channel, const char *_csv)
if (ares_strlen(_csv) == 0) { if (ares_strlen(_csv) == 0) {
/* blank all servers */ /* 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); status = ares__sconfig_append_fromstr(&slist, _csv, ARES_FALSE);

@ -19,7 +19,7 @@ IF (CARES_BUILD_TOOLS)
C_STANDARD 90 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}) TARGET_LINK_LIBRARIES (ahost PRIVATE ${PROJECT_NAME})
IF (CARES_INSTALL) IF (CARES_INSTALL)
INSTALL (TARGETS ahost COMPONENT Tools ${TARGETS_INST_DEST}) INSTALL (TARGETS ahost COMPONENT Tools ${TARGETS_INST_DEST})
@ -40,7 +40,7 @@ IF (CARES_BUILD_TOOLS)
C_STANDARD 90 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}) TARGET_LINK_LIBRARIES (adig PRIVATE ${PROJECT_NAME})
IF (CARES_INSTALL) IF (CARES_INSTALL)
INSTALL (TARGETS adig COMPONENT Tools ${TARGETS_INST_DEST}) INSTALL (TARGETS adig COMPONENT Tools ${TARGETS_INST_DEST})

@ -15,7 +15,8 @@ noinst_PROGRAMS =$(PROGS)
AM_CPPFLAGS += -I$(top_builddir)/include \ AM_CPPFLAGS += -I$(top_builddir)/include \
-I$(top_builddir)/src/lib \ -I$(top_builddir)/src/lib \
-I$(top_srcdir)/include \ -I$(top_srcdir)/include \
-I$(top_srcdir)/src/lib -I$(top_srcdir)/src/lib \
-DCARES_NO_DEPRECATED
include Makefile.inc include Makefile.inc

@ -38,17 +38,22 @@ add_executable(arestest ${TESTSOURCES} ${TESTHEADERS})
target_include_directories(arestest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_include_directories(arestest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(arestest PRIVATE caresinternal GTest::gmock) target_link_libraries(arestest PRIVATE caresinternal GTest::gmock)
target_compile_definitions(arestest PRIVATE CARES_NO_DEPRECATED)
IF (CARES_BUILD_CONTAINER_TESTS) IF (CARES_BUILD_CONTAINER_TESTS)
target_compile_definitions(arestest PRIVATE HAVE_USER_NAMESPACE HAVE_UTS_NAMESPACE) target_compile_definitions(arestest PRIVATE HAVE_USER_NAMESPACE HAVE_UTS_NAMESPACE)
ENDIF () ENDIF ()
add_executable(aresfuzz ${FUZZSOURCES}) add_executable(aresfuzz ${FUZZSOURCES})
target_compile_definitions(aresfuzz PRIVATE CARES_NO_DEPRECATED)
target_link_libraries(aresfuzz PRIVATE caresinternal) target_link_libraries(aresfuzz PRIVATE caresinternal)
add_executable(aresfuzzname ${FUZZNAMESOURCES}) add_executable(aresfuzzname ${FUZZNAMESOURCES})
target_compile_definitions(aresfuzzname PRIVATE CARES_NO_DEPRECATED)
target_link_libraries(aresfuzzname PRIVATE caresinternal) target_link_libraries(aresfuzzname PRIVATE caresinternal)
add_executable(dnsdump ${DUMPSOURCES}) add_executable(dnsdump ${DUMPSOURCES})
target_compile_definitions(dnsdump PRIVATE CARES_NO_DEPRECATED)
target_link_libraries(dnsdump PRIVATE caresinternal) target_link_libraries(dnsdump PRIVATE caresinternal)
# register tests # register tests

2
test/Makefile.am vendored

@ -8,7 +8,7 @@ AM_CPPFLAGS += -I$(top_builddir)/include \
-I$(top_srcdir)/src/lib \ -I$(top_srcdir)/src/lib \
-I$(top_srcdir)/test \ -I$(top_srcdir)/test \
-I$(top_builddir)/test \ -I$(top_builddir)/test \
-I$(top_builddir) -I$(top_builddir) -DCARES_NO_DEPRECATED
AM_CXXFLAGS := AM_CXXFLAGS :=
AM_CXXFLAGS += $(PTHREAD_CFLAGS) AM_CXXFLAGS += $(PTHREAD_CFLAGS)

2
test/Makefile.m32 vendored

@ -19,7 +19,7 @@ ARES_SRC_DIR = ..
# Where to find the built c-ares static library # Where to find the built c-ares static library
ARES_BLD_DIR = .. ARES_BLD_DIR = ..
ARESLIB = $(ARES_BLD_DIR)/src/lib/libcares.a 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 CXXFLAGS = -Wall $(PTHREAD_CFLAGS) -std=gnu++14
LDFLAGS = LDFLAGS =
LDLIBS = -lws2_32 -liphlpapi LDLIBS = -lws2_32 -liphlpapi

@ -192,7 +192,7 @@ LINK_CMD_EXE_DBG = $(LINK_CMD_EXE) /debug $(PDBTYPE_CONSOLIDATE)
CARES_TARGET = $(STA_LIB_REL).lib CARES_TARGET = $(STA_LIB_REL).lib
CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB
CARES_LFLAGS = 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 SPROG_LFLAGS = /libpath:$(LIB_OUTDIR) $(EX_LIBS_REL) $(STA_LIB_REL).lib
CARES_LINK = $(LINK_CMD_LIB) CARES_LINK = $(LINK_CMD_LIB)
SPROG_LINK = $(LINK_CMD_EXE_REL) SPROG_LINK = $(LINK_CMD_EXE_REL)
@ -203,7 +203,7 @@ CC_CMD = $(CC_CMD_REL)
CARES_TARGET = $(STA_LIB_DBG).lib CARES_TARGET = $(STA_LIB_DBG).lib
CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB /DDEBUGBUILD CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB /DDEBUGBUILD
CARES_LFLAGS = 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 SPROG_LFLAGS = /libpath:$(LIB_OUTDIR) $(EX_LIBS_DBG) $(STA_LIB_DBG).lib
CARES_LINK = $(LINK_CMD_LIB) CARES_LINK = $(LINK_CMD_LIB)
SPROG_LINK = $(LINK_CMD_EXE_DBG) SPROG_LINK = $(LINK_CMD_EXE_DBG)
@ -214,7 +214,7 @@ CC_CMD = $(CC_CMD_DBG)
CARES_TARGET = $(DYN_LIB_REL).dll CARES_TARGET = $(DYN_LIB_REL).dll
CARES_CFLAGS = /DCARES_BUILDING_LIBRARY CARES_CFLAGS = /DCARES_BUILDING_LIBRARY
CARES_LFLAGS = /release $(EX_LIBS_REL) /implib:$(PROG_OUTDIR)\$(IMP_LIB_REL).lib $(PDB_NONE) 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 SPROG_LFLAGS = /libpath:$(LIB_OUTDIR) $(EX_LIBS_REL) $(IMP_LIB_REL).lib
CARES_LINK = $(LINK_CMD_DLL) CARES_LINK = $(LINK_CMD_DLL)
SPROG_LINK = $(LINK_CMD_EXE_REL) SPROG_LINK = $(LINK_CMD_EXE_REL)
@ -227,7 +227,7 @@ RC_CMD = $(RC_CMD_REL)
CARES_TARGET = $(DYN_LIB_DBG).dll CARES_TARGET = $(DYN_LIB_DBG).dll
CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DDEBUGBUILD 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) 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 SPROG_LFLAGS = /libpath:$(LIB_OUTDIR) $(EX_LIBS_DBG) $(IMP_LIB_DBG).lib
CARES_LINK = $(LINK_CMD_DLL) CARES_LINK = $(LINK_CMD_DLL)
SPROG_LINK = $(LINK_CMD_EXE_DBG) SPROG_LINK = $(LINK_CMD_EXE_DBG)

Loading…
Cancel
Save