[PATCH 13/30] Header changes for windows support


Michael Schonberg <mschonberg@...>
 

Removed Linux specific #include's from MAMA files and added the missing
ones to common/.../linux/port.h.

Signed-off-by: Mike Schonberg <mschonberg@nyx.com>
---
common/c_cpp/src/c/linux/port.h | 6 ++++++
mama/c_cpp/src/c/datetime.c | 3 +--
mama/c_cpp/src/c/ft.c | 10 ----------
mama/c_cpp/src/c/imagerequest.c | 2 +-
mama/c_cpp/src/c/imagerequest.h | 2 +-
mama/c_cpp/src/c/mama.c | 15 +--------------
mama/c_cpp/src/c/mama/types.h | 2 +-
mama/c_cpp/src/c/msg.c | 2 +-
mama/c_cpp/src/c/queue.c | 2 +-
mama/c_cpp/src/c/senderId.c | 7 +------
mama/c_cpp/src/c/stat.c | 2 +-
mama/c_cpp/src/c/timezone.c | 4 +---
12 files changed, 16 insertions(+), 41 deletions(-)

diff --git a/common/c_cpp/src/c/linux/port.h b/common/c_cpp/src/c/linux/port.h
index 8b4b873..9e77781 100644
--- a/common/c_cpp/src/c/linux/port.h
+++ b/common/c_cpp/src/c/linux/port.h
@@ -35,18 +35,24 @@ extern "C"

#include <pthread.h>
#include <sys/types.h>
+#include <sys/ioctl.h>
#include <sys/vfs.h>
#include <sys/param.h>
#include <sys/resource.h>
#include <sys/time.h>
#include <sys/times.h>
#include <sys/socket.h>
+#include <sys/utsname.h>
+#include <arpa/inet.h>
#include <netinet/in.h>
+#include <net/if.h>
+#include <netdb.h>
#include <semaphore.h>
#include <dirent.h>
#include <dlfcn.h>
#include <unistd.h>
#include <inttypes.h>
+#include <pwd.h>

/* Call Types */
#define COMMONExpDLL
diff --git a/mama/c_cpp/src/c/datetime.c b/mama/c_cpp/src/c/datetime.c
index a489c9b..3639fa6 100644
--- a/mama/c_cpp/src/c/datetime.c
+++ b/mama/c_cpp/src/c/datetime.c
@@ -688,8 +688,7 @@ mamaDateTime_getEpochTime(const mamaDateTime dateTime,
precision, NULL);
}

-MAMAExpDLL
-extern mama_status
+mama_status
mamaDateTime_getEpochTimeWithTz(const mamaDateTime dateTime,
mama_u32_t* seconds,
mama_u32_t* microseconds,
diff --git a/mama/c_cpp/src/c/ft.c b/mama/c_cpp/src/c/ft.c
index 0a7931c..700a022 100644
--- a/mama/c_cpp/src/c/ft.c
+++ b/mama/c_cpp/src/c/ft.c
@@ -27,17 +27,7 @@
#include <mama/ft.h>
#include <mama/io.h>

-
-#include <netinet/in.h>
-#include <unistd.h>
-#include <net/if.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <netdb.h>
-#include <arpa/inet.h>
#include <sys/types.h>
-#include <net/if.h>
-#include <sys/ioctl.h>


#define FT_SYMBOL_PREFIX "MAMA_FT"
diff --git a/mama/c_cpp/src/c/imagerequest.c b/mama/c_cpp/src/c/imagerequest.c
index 8a044db..7e42ed6 100644
--- a/mama/c_cpp/src/c/imagerequest.c
+++ b/mama/c_cpp/src/c/imagerequest.c
@@ -19,7 +19,7 @@
* 02110-1301 USA
*/

-#include <pthread.h>
+#include "port.h"
#include <mama/mama.h>
#include <mamainternal.h>
#include <imagerequest.h>
diff --git a/mama/c_cpp/src/c/imagerequest.h b/mama/c_cpp/src/c/imagerequest.h
index 2ce4d5b..9605916 100644
--- a/mama/c_cpp/src/c/imagerequest.h
+++ b/mama/c_cpp/src/c/imagerequest.h
@@ -22,7 +22,7 @@
#ifndef MamaImageRequestH__
#define MamaImageRequestH__

-#include <inttypes.h>
+#include "port.h"

#include "wombat/wincompat.h"
#include "throttle.h"
diff --git a/mama/c_cpp/src/c/mama.c b/mama/c_cpp/src/c/mama.c
index 0657286..9ac45b4 100644
--- a/mama/c_cpp/src/c/mama.c
+++ b/mama/c_cpp/src/c/mama.c
@@ -23,21 +23,8 @@
#include <stdio.h>
#include <limits.h>

-#include "wombat/wincompat.h"
+#include "port.h"
#include "wombat/environment.h"
-
-
-#include <netdb.h>
-#include <sys/utsname.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <pwd.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <dlfcn.h>
-#include <pthread.h>
-
#include "wombat/strutils.h"

#include <mama/mama.h>
diff --git a/mama/c_cpp/src/c/mama/types.h b/mama/c_cpp/src/c/mama/types.h
index 67d4086..4874fc8 100644
--- a/mama/c_cpp/src/c/mama/types.h
+++ b/mama/c_cpp/src/c/mama/types.h
@@ -26,7 +26,7 @@
extern "C" {
#endif

-#include <inttypes.h>
+#include "port.h"
#include <stdlib.h>
#include <string.h>

diff --git a/mama/c_cpp/src/c/msg.c b/mama/c_cpp/src/c/msg.c
index 59d7e11..ca26b6b 100644
--- a/mama/c_cpp/src/c/msg.c
+++ b/mama/c_cpp/src/c/msg.c
@@ -20,6 +20,7 @@
* 02110-1301 USA
*/

+#include "port.h"
#include <stdlib.h>
#include <string.h>
#include <assert.h>
@@ -39,7 +40,6 @@
#include "list.h"

#include "wombat/wincompat.h"
-#include "inttypes.h"


#define MAX_SUBJECT 256
diff --git a/mama/c_cpp/src/c/queue.c b/mama/c_cpp/src/c/queue.c
index 7190819..2dcda25 100644
--- a/mama/c_cpp/src/c/queue.c
+++ b/mama/c_cpp/src/c/queue.c
@@ -19,6 +19,7 @@
* 02110-1301 USA
*/

+#include "port.h"
#include <mama/mama.h>
#include <mama/queue.h>
#include "bridge.h"
@@ -31,7 +32,6 @@
#include "statinternal.h"
#include "wlock.h"
#include "wombat/wInterlocked.h"
-#include <pthread.h>
#include <wombat/strutils.h>

extern int gGenerateQueueStats;
diff --git a/mama/c_cpp/src/c/senderId.c b/mama/c_cpp/src/c/senderId.c
index 5650d31..f37c94c 100644
--- a/mama/c_cpp/src/c/senderId.c
+++ b/mama/c_cpp/src/c/senderId.c
@@ -19,12 +19,7 @@
* 02110-1301 USA
*/

-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-
+#include "port.h"
#include "wombat/wincompat.h"
#include "mama/senderId.h"

diff --git a/mama/c_cpp/src/c/stat.c b/mama/c_cpp/src/c/stat.c
index 8dfa8b5..4564edb 100644
--- a/mama/c_cpp/src/c/stat.c
+++ b/mama/c_cpp/src/c/stat.c
@@ -19,9 +19,9 @@
* 02110-1301 USA
*/

+#include "port.h"
#include <string.h>
#include <stddef.h>
-#include <pthread.h>
#include "wombat/wincompat.h"
#include "mama/types.h"
#include "mama/mama.h"
diff --git a/mama/c_cpp/src/c/timezone.c b/mama/c_cpp/src/c/timezone.c
index 3754d23..932a48b 100644
--- a/mama/c_cpp/src/c/timezone.c
+++ b/mama/c_cpp/src/c/timezone.c
@@ -19,14 +19,12 @@
* 02110-1301 USA
*/

+#include "port.h"
#include "wombat/environment.h"
#include <mama/timezone.h>
#include <list.h>
#include <string.h>
#include <stdio.h>
-#include <unistd.h>
-#include <pthread.h>
-#include <sys/time.h>
#include <wombat/wincompat.h>
#include <time.h>
#include <assert.h>
--
1.7.7.6