[PATCH 30/30] Renamed resolve_ip to wresolve_ip


Michael Schonberg <mschonberg@...>
 

Renamed resolve_ip() to avoid naming conflicts. Also removed shared object
export prefixes from port.h as they are now in wConfig.h.

Signed-off-by: Mike Schonberg <mschonberg@nyx.com>
---
common/c_cpp/src/c/linux/network.c | 2 +-
common/c_cpp/src/c/linux/platform.c | 3 +-
common/c_cpp/src/c/linux/port.h | 14 +------
common/c_cpp/src/c/windows/network.c | 2 +-
common/c_cpp/src/c/windows/port.h | 76 +---------------------------------
common/c_cpp/src/c/wombat/wCommon.h | 2 +-
mama/c_cpp/src/c/ft.c | 4 +-
7 files changed, 9 insertions(+), 94 deletions(-)

diff --git a/common/c_cpp/src/c/linux/network.c b/common/c_cpp/src/c/linux/network.c
index 75e5658..9969ff9 100644
--- a/common/c_cpp/src/c/linux/network.c
+++ b/common/c_cpp/src/c/linux/network.c
@@ -25,7 +25,7 @@
#include "wombat/wCommon.h"


-struct in_addr resolve_ip (const char * arg)
+struct in_addr wresolve_ip (const char * arg)
{

struct in_addr resolved;
diff --git a/common/c_cpp/src/c/linux/platform.c b/common/c_cpp/src/c/linux/platform.c
index 881ecde..dcab90a 100644
--- a/common/c_cpp/src/c/linux/platform.c
+++ b/common/c_cpp/src/c/linux/platform.c
@@ -1,5 +1,4 @@
-/* $Id: platform.c,v 1.8.16.2 2011/08/10 14:53:24 nicholasmarriott Exp $
- *
+/*
* OpenMAMA: The open middleware agnostic messaging API
* Copyright (C) 2011 NYSE Inc.
*
diff --git a/common/c_cpp/src/c/linux/port.h b/common/c_cpp/src/c/linux/port.h
index 35877a1..c328479 100644
--- a/common/c_cpp/src/c/linux/port.h
+++ b/common/c_cpp/src/c/linux/port.h
@@ -55,15 +55,7 @@ extern "C"
#include <inttypes.h>
#include <pwd.h>

-/* Call Types */
-#define COMMONExpDLL
-#define WMWExpDLL
-#define MAMAExpDLL
-#define MAMACPPExpDLL
-#define MAMDAExpDLL
-#define MAMDAOPTExpDLL
-#define MAMAExpBridgeDLL
-#define MAMACALLTYPE
+#include "wConfig.h"

/* PTHREAD static locks are easy */
typedef pthread_mutex_t wthread_static_mutex_t;
@@ -71,10 +63,6 @@ typedef pthread_mutex_t wthread_static_mutex_t;
#define wthread_static_mutex_lock(x) pthread_mutex_lock((x))
#define wthread_static_mutex_unlock(x) pthread_mutex_unlock((x))

-
-#define WCOMMONINLINE inline static
-#define WCOMMONFORCEINLINE inline static
-
/* Type for handle to dynamically loaded library */
typedef void* LIB_HANDLE;

diff --git a/common/c_cpp/src/c/windows/network.c b/common/c_cpp/src/c/windows/network.c
index e7c1ece..b80914e 100644
--- a/common/c_cpp/src/c/windows/network.c
+++ b/common/c_cpp/src/c/windows/network.c
@@ -20,7 +20,7 @@

#include "port.h"

-struct in_addr resolve_ip (const char * arg)
+struct in_addr wresolve_ip (const char * arg)
{
struct in_addr resolved;

diff --git a/common/c_cpp/src/c/windows/port.h b/common/c_cpp/src/c/windows/port.h
index 7df1f55..92080fd 100644
--- a/common/c_cpp/src/c/windows/port.h
+++ b/common/c_cpp/src/c/windows/port.h
@@ -37,6 +37,7 @@
#include <tlhelp32.h>
#include <time.h>

+#include "wConfig.h"
#include "lock.h"
#include "mmap.h"

@@ -47,9 +48,6 @@ extern "C" {
/* So Windows compiler ignores gcc __attribute__(x) */
#define __attribute__(a)

-#define WCOMMONINLINE __inline
-#define WCOMMONFORCEINLINE __forceinline
-
/* Type for handle to dynamically loaded library */
typedef HINSTANCE LIB_HANDLE;

@@ -89,76 +87,6 @@ typedef __int64 w_i64_t;

#define PATHSEP "\\"

-/* Calling conventions */
-#define MAMACALLTYPE __stdcall
-
-#if defined( COMMON_DLL )
- /* We are building common dll */
-# define COMMONExpDLL __declspec( dllexport )
-#elif defined( MAMA_DLL ) && defined( MAMA )
- /* We are building mama as a dll */
-# define COMMONExpDLL __declspec( dllimport )
-# define MAMAExpDLL __declspec( dllexport )
-# define MAMAExpBridgeDLL __declspec( dllexport )
-#elif defined( MAMA_DLL ) && defined( BRIDGE )
- /* We are building mama bridge as a dll */
-# define MAMAExpDLL __declspec( dllimport )
-# define MAMAExpBridgeDLL __declspec( dllimport )
-# define COMMONExpDLL __declspec( dllimport )
-# define MAMACPPExpDLL
-# define MAMDAExpDLL
-# define MAMDAOPTExpDLL
-# define WMWExpDLL __declspec( dllimport )
-#elif defined( MAMA_DLL ) && defined( MAMACPP )
- /* We are building mamacpp as a dll */
-# define COMMONExpDLL __declspec( dllimport )
-# define MAMAExpDLL __declspec( dllimport )
-# define MAMACPPExpDLL __declspec( dllexport )
-# define MAMAExpBridgeDLL
-#elif defined( MAMDA_DLL ) && defined( MAMDA )
- /* We are building mamda as a dll */
-# define COMMONExpDLL __declspec( dllimport )
-# define MAMAExpDLL __declspec( dllimport )
-# define MAMACPPExpDLL __declspec( dllimport )
-# define MAMDAExpDLL __declspec( dllexport )
-# define MAMAExpBridgeDLL
-#elif defined( MAMDA_DLL ) && defined( MAMDAOPT )
- /* We are building extra mamda as a dll */
-# define COMMONExpDLL __declspec( dllimport )
-# define MAMAExpDLL __declspec( dllimport )
-# define MAMACPPExpDLL __declspec( dllimport )
-# define MAMDAExpDLL __declspec( dllimport )
-# define MAMDAOPTExpDLL __declspec( dllexport )
-# define MAMAExpBridgeDLL
-#elif !defined ( MAMA_STATIC ) && !defined ( WMW_STATIC ) && !defined (WIRECACHE_STATIC)
- /* We are building mama apps (non static) */
-# define COMMONExpDLL __declspec( dllimport )
-# define WMWExpDLL __declspec( dllexport )
-# define MAMAExpDLL __declspec( dllimport )
-# define MAMACPPExpDLL __declspec( dllimport )
-# define MAMDAExpDLL __declspec( dllimport )
-# define MAMDAOPTExpDLL __declspec( dllimport )
-# define MAMAExpBridgeDLL
-#elif defined( WIN32 ) && defined( WMW_DLL )
- /* We are building wmw as a dll */
-# define COMMONExpDLL __declspec( dllimport )
-# define WMWExpDLL __declspec( dllexport )
-#elif defined( WIN32 ) && defined( WMW_APP )
- /* We are building wmw test apps */
-# define COMMONExpDLL __declspec( dllimport )
-# define WMWExpDLL __declspec( dllimport )
-#else
- /* We are building on linux or statically */
-# define COMMONExpDLL
-# define WMWExpDLL
-# define WCACHEExpDLL
-# define MAMAExpDLL
-# define MAMACPPExpDLL
-# define MAMDAExpDLL
-# define MAMDAOPTExpDLL
-# define MAMAExpBridgeDLL
-#endif
-
/* Socket Pair and set non blocking */
COMMONExpDLL int
wsocketpair (int domain, int type, int protocol, int* pair);
@@ -172,7 +100,7 @@ wsetnonblock (int s);
COMMONExpDLL const char* getIpAddress (void);
COMMONExpDLL const char* getHostName (void);
COMMONExpDLL const char* getlogin (void);
-COMMONExpDLL struct in_addr resolve_ip (const char * arg);
+COMMONExpDLL struct in_addr wresolve_ip (const char * arg);

/* Thread local storage */
typedef DWORD wthread_key_t;
diff --git a/common/c_cpp/src/c/wombat/wCommon.h b/common/c_cpp/src/c/wombat/wCommon.h
index 647751b..71085b9 100644
--- a/common/c_cpp/src/c/wombat/wCommon.h
+++ b/common/c_cpp/src/c/wombat/wCommon.h
@@ -25,6 +25,6 @@
/* Moved to _os_/port.h */
#include "wombat/port.h"

-struct in_addr resolve_ip(const char * arg);
+struct in_addr wresolve_ip(const char * arg);

#endif /* _WOMBAT_WCOMMON_H */
diff --git a/mama/c_cpp/src/c/ft.c b/mama/c_cpp/src/c/ft.c
index 1948650..97c9bae 100644
--- a/mama/c_cpp/src/c/ft.c
+++ b/mama/c_cpp/src/c/ft.c
@@ -204,7 +204,7 @@ void checkHeartbeat (mamaFtMemberImpl* impl,
int hbPrimary,
char* hbGroupName);

-struct in_addr resolve_ip (const char * arg);
+struct in_addr wresolve_ip (const char * arg);

/* FT callbacks: */
static void MAMACALLTYPE
@@ -882,7 +882,7 @@ multicastFt_setup (
/* if interface name is set */
if (ftInterface!=NULL && ftInterface[0]!='\0')
{
- cFtIfAddr = resolve_ip (ftInterface);
+ cFtIfAddr = wresolve_ip (ftInterface);

if (cFtIfAddr.s_addr == INADDR_NONE)
{
--
1.7.7.6

Join Openmama-dev@lists.openmama.org to automatically receive all group messages.