Navigation Menu

Skip to content

Commit

Permalink
- Provide in external interface preprocessor symbol definitions for
Browse files Browse the repository at this point in the history
  CARES_HAVE_ARES_LIBRARY_INIT and CARES_HAVE_ARES_LIBRARY_CLEANUP
  to ease the use of new capabilities.

- Move ares_version() prototype to ares.h
  • Loading branch information
yangtse committed May 18, 2009
1 parent b7c7bab commit 5b17412
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Makefile.vc6
Expand Up @@ -221,7 +221,7 @@ $(OBJ_DIR)\ares_destroy.obj: ares_destroy.c setup.h setup_once.h ares.h \
$(OBJ_DIR)\ares_mkquery.obj: ares_mkquery.c setup.h setup_once.h nameser.h \
ares.h ares_dns.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_version.obj: ares_version.c setup.h setup_once.h \
$(OBJ_DIR)\ares_version.obj: ares_version.c setup.h setup_once.h ares.h \
ares_version.h ares_build.h ares_rules.h

$(OBJ_DIR)\ares_expand_name.obj: ares_expand_name.c setup.h setup_once.h \
Expand Down
6 changes: 4 additions & 2 deletions ares.h
Expand Up @@ -19,8 +19,9 @@
#ifndef ARES__H
#define ARES__H

#include "ares_build.h" /* c-ares build definitions */
#include "ares_rules.h" /* c-ares rules enforcement */
#include "ares_version.h" /* c-ares version defines */
#include "ares_build.h" /* c-ares build definitions */
#include "ares_rules.h" /* c-ares rules enforcement */

/*
* Define WIN32 when build target is Win32 API
Expand Down Expand Up @@ -248,6 +249,7 @@ typedef int (*ares_sock_create_callback)(ares_socket_t socket_fd,

int ares_library_init(int flags);
void ares_library_cleanup(void);
const char *ares_version(int *version);

int ares_init(ares_channel *channelptr);
int ares_init_options(ares_channel *channelptr, struct ares_options *options,
Expand Down
2 changes: 1 addition & 1 deletion ares_version.c
@@ -1,7 +1,7 @@
/* $Id$ */

#include "setup.h"
#include "ares_version.h"
#include "ares.h"

const char *ares_version(int *version)
{
Expand Down
15 changes: 6 additions & 9 deletions ares_version.h
Expand Up @@ -11,15 +11,12 @@
(ARES_VERSION_PATCH))
#define ARES_VERSION_STR "1.6.1-CVS"

#ifdef __cplusplus
extern "C" {
#endif

const char *ares_version(int *version);

#ifdef __cplusplus
}
#if (ARES_VERSION >= 0x010601)
# define CARES_HAVE_ARES_LIBRARY_INIT 1
# define CARES_HAVE_ARES_LIBRARY_CLEANUP 1
#else
# undef CARES_HAVE_ARES_LIBRARY_INIT
# undef CARES_HAVE_ARES_LIBRARY_CLEANUP
#endif

#endif

0 comments on commit 5b17412

Please sign in to comment.