From aa421ffc4575ab9ad1768f10f32fdfe360e43cbe Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Thu, 7 Apr 2005 02:18:41 +0000 Subject: [PATCH] Move the definition if INADDR_NONE in the unique file that use it. Anyway the ompi_config_bottom.h was a bad place to have it as normally this file is included before everything else so we always define our own INADDR_NONE generating a lot of warnings on some OSes. This commit was SVN r5198. --- include/ompi_config_bottom.h | 14 -------------- src/util/if.c | 12 ++++++++++++ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/include/ompi_config_bottom.h b/include/ompi_config_bottom.h index 454c4317ce..6ae92a102d 100644 --- a/include/ompi_config_bottom.h +++ b/include/ompi_config_bottom.h @@ -233,20 +233,6 @@ typedef struct { #endif #endif - -/* - * Define INADDR_NONE if we don't have it. Solaris is the only system - * where I have found that it does not exist, and the man page for - * inet_addr() says that it returns -1 upon failure. On Linux and - * other systems with INADDR_NONE, it's just a #define to -1 anyway. - * So just #define it to -1 here if it doesn't already exist. - */ - -#if defined(OMPI_BUILDING) && OMPI_BUILDING && !defined(INADDR_NONE) -#define INADDR_NONE -1 -#endif - - /* * Define __func__-preprocessor directive if the compiler does not * already define it. Define it to __FILE__ so that we at least have diff --git a/src/util/if.c b/src/util/if.c index 71be1a0aea..f0bdaab88a 100644 --- a/src/util/if.c +++ b/src/util/if.c @@ -55,6 +55,18 @@ #define IF_NAMESIZE 32 #endif +/* + * Define INADDR_NONE if we don't have it. Solaris is the only system + * where I have found that it does not exist, and the man page for + * inet_addr() says that it returns -1 upon failure. On Linux and + * other systems with INADDR_NONE, it's just a #define to -1 anyway. + * So just #define it to -1 here if it doesn't already exist. + */ + +#if !defined(INADDR_NONE) +#define INADDR_NONE -1 +#endif + struct ompi_if_t { ompi_list_item_t super; char if_name[IF_NAMESIZE];