[PATCH 00/30] Preparing for Windows Support


Michael Schonberg <mschonberg@...>
 

From: Mike Schonberg <mschonberg@nyx.com>

This rather large patch set introduces the changes required for Windows support.
Prior to OpenMAMA, MAMA supported other operating systems (Windows and Solaris)
through conditional compilation with ifdef's. This approach proved messy and
difficult to maintain.

For OpenMAMA, we removed most of the "#ifdef WIN32" blocks with the intention of
reintroducing Windows support in a better way. The following patches move all of
the Windows specific code to the windows subdirectory in common and puts the
Linux equivalents in a linux subdirectory when necessary. Most of the
portability layer consists of macros and small inline functions and is almost
entirely identical to the old #ifdef code; however, rather than scattering it
throughout the code base we have it all in one place.

This should greatly simplify future ports to Solaris and other platform:
implementors only need to reproduce the compatibility layer for the new
platform.

NOTE: The build infrastructure for Windows is not part of this patch set. It
will be checked in with the C++, Java and MAMDA support in the next few weeks.

Michael Schonberg (29):
Move Linux Specific #includes and Macros
Moved Calling Convention from wConfig.h to linux/port.h
Moved environment.c to linux/environment.c
Moved linux code from machine.c to linux/machine.c
Moved platform.c to linux/platform.c
Moved wincompat.h contents to _os_/port.h
Changes for queue.c to build on windows
wlock.c changes for windows support
Preparing timer.c and timer.c for windows support
Move wSemaphore.c to linx/wSemaphroe.c
Moved macros for inline functions to _os_/port.h
Added wthread_global_mutex macros
Header changes for windows support
Prepare ft.c for Windows support
Removed PATHSEP macro
Added Thread Local Storage
Added getHostName and getIpAddress.
mama.c changes for windows support
Add wtimegm macro for poritning timegm
Correct Method Signatures for Linking On Windows
Correct windows calling convention for queue
Conflation manager fixes for windows
Replaced numerous #ifdef WIN32 with port.h
Removed #ifdef WIN32 from playbackFileParser
Adding new common/../windows/* files
Changes for Windows
Added wdlXXX macos to linux/port.h
Moved port.h to wombat sub directory
Renamed resolve_ip to wresolve_ip

Mike Schonberg (1):
Moved wombat/wInterlocked.h to Linux directory

common/c_cpp/configure.ac | 13 +
common/c_cpp/src/c/MRSWLock.c | 2 +-
common/c_cpp/src/c/Makefile.am | 3 +
common/c_cpp/src/c/destroyHandle.c | 1 +
common/c_cpp/src/c/environment.c | 59 --
common/c_cpp/src/c/linux/environment.c | 59 ++
common/c_cpp/src/c/linux/machine.c | 599 ++++++++++++++++++++
common/c_cpp/src/c/linux/network.c | 195 +++++++
common/c_cpp/src/c/linux/platform.c | 84 +++
common/c_cpp/src/c/linux/port.h | 181 ++++++
common/c_cpp/src/c/linux/wConfig.h | 40 ++
common/c_cpp/src/c/linux/wInterlocked.h | 142 +++++
common/c_cpp/src/c/linux/wSemaphore.c | 57 ++
common/c_cpp/src/c/list.c | 6 +-
common/c_cpp/src/c/machine.c | 575 +-------------------
common/c_cpp/src/c/platform.c | 88 ---
common/c_cpp/src/c/platform.h | 21 -
common/c_cpp/src/c/properties.l | 16 +-
common/c_cpp/src/c/property.c | 4 +-
common/c_cpp/src/c/queue.c | 110 ++---
common/c_cpp/src/c/strutils.c | 7 +-
common/c_cpp/src/c/systree.h | 4 -
common/c_cpp/src/c/timers.c | 176 +++---
common/c_cpp/src/c/timers.h | 5 +-
common/c_cpp/src/c/wSemaphore.c | 192 -------
common/c_cpp/src/c/windows/environment.c | 81 +++
common/c_cpp/src/c/windows/lock.h | 82 +++
common/c_cpp/src/c/windows/machine_win.c | 213 +++++++
common/c_cpp/src/c/windows/mmap.h | 28 +
common/c_cpp/src/c/windows/network.c | 87 +++
common/c_cpp/src/c/windows/platform.c | 84 +++
common/c_cpp/src/c/windows/port.c | 276 +++++++++
common/c_cpp/src/c/windows/port.h | 251 ++++++++
common/c_cpp/src/c/windows/wSemaphore.c | 147 +++++
common/c_cpp/src/c/windows/wombat/targetsxs.h | 38 ++
common/c_cpp/src/c/windows/wombat/wConfig.h | 101 ++++
common/c_cpp/src/c/windows/wombat/wInterlocked.h | 97 ++++
common/c_cpp/src/c/wlock.c | 11 +-
common/c_cpp/src/c/wlock.h | 5 -
common/c_cpp/src/c/wombat/queue.h | 67 +--
common/c_cpp/src/c/wombat/strutils.h | 7 -
common/c_cpp/src/c/wombat/wCommon.h | 27 +-
common/c_cpp/src/c/wombat/wConfig.h | 99 +----
common/c_cpp/src/c/wombat/wInterlocked.h | 142 -----
common/c_cpp/src/c/wombat/wSemaphore.h | 51 +--
common/c_cpp/src/c/wombat/wincompat.h | 49 +--
mama/c_cpp/src/c/bridge/avis/bridge.c | 5 +-
mama/c_cpp/src/c/bridge/avis/msg.c | 5 +-
mama/c_cpp/src/c/bridge/avis/transportbridge.c | 5 +-
mama/c_cpp/src/c/conflation/connection.c | 4 +-
mama/c_cpp/src/c/conflation/connection_int.h | 10 +-
mama/c_cpp/src/c/conflation/manager.c | 10 +-
mama/c_cpp/src/c/conflation/manager_int.h | 4 +-
mama/c_cpp/src/c/conflation/serverconnection_int.h | 8 +-
mama/c_cpp/src/c/datetime.c | 5 +-
mama/c_cpp/src/c/fileutils.c | 1 -
mama/c_cpp/src/c/ft.c | 203 ++------
mama/c_cpp/src/c/imagerequest.c | 2 +-
mama/c_cpp/src/c/imagerequest.h | 2 +-
mama/c_cpp/src/c/mama.c | 163 ++----
mama/c_cpp/src/c/mama/conflation/manager.h | 16 +-
mama/c_cpp/src/c/mama/datetime.h | 4 +-
mama/c_cpp/src/c/mama/fielddesc.h | 4 +-
mama/c_cpp/src/c/mama/ft.h | 4 +-
mama/c_cpp/src/c/mama/mama.h | 14 +-
mama/c_cpp/src/c/mama/msg.h | 14 +-
mama/c_cpp/src/c/mama/msgfield.h | 4 +-
mama/c_cpp/src/c/mama/subscriptiontype.h | 3 +-
mama/c_cpp/src/c/mama/timezone.h | 4 +-
mama/c_cpp/src/c/mama/types.h | 2 +-
mama/c_cpp/src/c/msg.c | 2 +-
mama/c_cpp/src/c/payload/avismsg/avismsgimpl.c | 4 +-
mama/c_cpp/src/c/playback/playbackFileParser.c | 31 +-
mama/c_cpp/src/c/playback/playbackFileParser.h | 10 +-
mama/c_cpp/src/c/playback/playbackpublisher.h | 5 +-
mama/c_cpp/src/c/priceimpl.c | 19 +-
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/statsgenerator.c | 2 +-
mama/c_cpp/src/c/statslogger.c | 4 +-
mama/c_cpp/src/c/syncresponder.c | 4 +-
mama/c_cpp/src/c/timezone.c | 36 +-
mama/c_cpp/src/examples/c/mamainboxc.c | 15 +-
mama/c_cpp/src/examples/c/mamaio.c | 9 +-
mama/c_cpp/src/examples/c/mamalistenc.c | 56 +-
mama/c_cpp/src/examples/c/mamaproxyc.c | 46 +-
mama/c_cpp/src/examples/c/mamapublisherc.c | 19 +-
mama/c_cpp/src/examples/c/mamasubscriberc.c | 20 +-
.../src/examples/c/mamasymbollistsubscriberc.c | 44 +-
mama/c_cpp/src/regression/c/tools/basicinbox.c | 31 +-
mama/c_cpp/src/regression/c/tools/basicpub.c | 50 +--
mama/c_cpp/src/regression/c/tools/basicsub.c | 61 +--
93 files changed, 3329 insertions(+), 2228 deletions(-)
delete mode 100644 common/c_cpp/src/c/environment.c
create mode 100644 common/c_cpp/src/c/linux/environment.c
create mode 100644 common/c_cpp/src/c/linux/machine.c
create mode 100644 common/c_cpp/src/c/linux/network.c
create mode 100644 common/c_cpp/src/c/linux/platform.c
create mode 100644 common/c_cpp/src/c/linux/port.h
create mode 100644 common/c_cpp/src/c/linux/wConfig.h
create mode 100644 common/c_cpp/src/c/linux/wInterlocked.h
create mode 100644 common/c_cpp/src/c/linux/wSemaphore.c
delete mode 100644 common/c_cpp/src/c/platform.c
delete mode 100644 common/c_cpp/src/c/wSemaphore.c
create mode 100644 common/c_cpp/src/c/windows/environment.c
create mode 100644 common/c_cpp/src/c/windows/lock.h
create mode 100644 common/c_cpp/src/c/windows/machine_win.c
create mode 100644 common/c_cpp/src/c/windows/mmap.h
create mode 100644 common/c_cpp/src/c/windows/network.c
create mode 100644 common/c_cpp/src/c/windows/platform.c
create mode 100644 common/c_cpp/src/c/windows/port.c
create mode 100644 common/c_cpp/src/c/windows/port.h
create mode 100644 common/c_cpp/src/c/windows/wSemaphore.c
create mode 100644 common/c_cpp/src/c/windows/wombat/targetsxs.h
create mode 100644 common/c_cpp/src/c/windows/wombat/wConfig.h
create mode 100644 common/c_cpp/src/c/windows/wombat/wInterlocked.h
mode change 100644 => 120000 common/c_cpp/src/c/wombat/wConfig.h
delete mode 100644 common/c_cpp/src/c/wombat/wInterlocked.h

--
1.7.7.6