Skip to content

Commit

Permalink
Provide ares_nameser.h as a public interface
Browse files Browse the repository at this point in the history
Implements #415.
  • Loading branch information
felixonmars committed Aug 17, 2021
1 parent 8eccad1 commit b9845b8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,12 @@ ENDIF()
IF (HAVE_WINDOWS_H)
SET (CARES_HAVE_WINDOWS_H 1)
ENDIF()
IF (HAVE_ARPA_NAMESER_H)
SET (CARES_HAVE_ARPA_NAMESER_H 1)
ENDIF()
IF (HAVE_ARPA_NAMESER_COMPAT_H)
SET (CARES_HAVE_ARPA_NAMESER_COMPAT_H 1)
ENDIF()

# Record toplevel CMakeLists.txt path
set(CARES_TOPLEVEL_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
Expand Down
2 changes: 1 addition & 1 deletion include/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ AUTOMAKE_OPTIONS = foreign nostdinc 1.9.6
ACLOCAL_AMFLAGS = -I m4 --install

# what headers to install on 'make install':
include_HEADERS = ares.h ares_version.h ares_build.h ares_rules.h ares_dns.h
include_HEADERS = ares.h ares_version.h ares_build.h ares_rules.h ares_dns.h ares_nameser.h

EXTRA_DIST = ares_build.h.cmake ares_build.h.in ares_build.h.dist CMakeLists.txt
2 changes: 2 additions & 0 deletions include/ares_build.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#cmakedefine CARES_HAVE_WS2TCPIP_H
#cmakedefine CARES_HAVE_WINSOCK2_H
#cmakedefine CARES_HAVE_WINDOWS_H
#cmakedefine CARES_HAVE_ARPA_NAMESER_H
#cmakedefine CARES_HAVE_ARPA_NAMESER_COMPAT_H

#ifdef CARES_HAVE_SYS_TYPES_H
# include <sys/types.h>
Expand Down
8 changes: 4 additions & 4 deletions src/lib/ares_nameser.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#ifndef ARES_NAMESER_H
#define ARES_NAMESER_H

#ifdef HAVE_ARPA_NAMESER_H
#ifdef CARES_HAVE_ARPA_NAMESER_H
# include <arpa/nameser.h>
#endif
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
#ifdef CARES_HAVE_ARPA_NAMESER_COMPAT_H
# include <arpa/nameser_compat.h>
#endif

Expand Down Expand Up @@ -68,7 +68,7 @@
* provide them
* ============================================================================
*/
#ifndef HAVE_ARPA_NAMESER_H
#ifndef CARES_HAVE_ARPA_NAMESER_H

typedef enum __ns_class {
ns_c_invalid = 0, /* Cookie. */
Expand Down Expand Up @@ -173,7 +173,7 @@ typedef enum __ns_rcode {
ns_r_badtime = 18
} ns_rcode;

#endif /* HAVE_ARPA_NAMESER_H */
#endif /* CARES_HAVE_ARPA_NAMESER_H */


/* ============================================================================
Expand Down

0 comments on commit b9845b8

Please sign in to comment.