From cf048bb1f8a665370d9e39aee2a7363327911b08 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Fri, 4 Jun 2010 16:29:36 +0200 Subject: platform.hpp for MSVC contains only very basic stuff --- builds/msvc/platform.hpp | 29 ----------------------------- perf/helpers.cpp | 4 +++- src/encoder.hpp | 5 +++++ src/prefix_tree.cpp | 5 +++++ src/uuid.cpp | 1 - src/uuid.hpp | 1 + src/windows.hpp | 4 ++++ src/zmq_engine.cpp | 6 +++++- 8 files changed, 23 insertions(+), 32 deletions(-) diff --git a/builds/msvc/platform.hpp b/builds/msvc/platform.hpp index bda30c9..b40d161 100644 --- a/builds/msvc/platform.hpp +++ b/builds/msvc/platform.hpp @@ -31,34 +31,5 @@ #define PACKAGE_VERSION_PATCH 7 #define ZMQ_HAVE_WINDOWS -#define _WINSOCKAPI_ -#define NOMINMAX -#define _CRT_SECURE_NO_WARNINGS - -// Turn on only the items zmq needs on the Windows platform. - -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#ifndef NOMCX // No Modem Configuration Extensions. -#define NOMCX -#endif -#ifndef NOIME // No Input Method Editor. -#define NOIME -#endif -#ifndef NOSOUND // No Sound driver routines. -#define NOSOUND -#endif - -#include -#include - -// Enable winsock (not included when WIN32_LEAN_AND_MEAN is defined). -#if(_WIN32_WINNT >= 0x0400) -#include -#include -#else -#include -#endif #endif diff --git a/perf/helpers.cpp b/perf/helpers.cpp index ddf1e45..94b653f 100644 --- a/perf/helpers.cpp +++ b/perf/helpers.cpp @@ -19,7 +19,9 @@ #include #include -#ifndef _WIN32 +#ifdef _WIN32 +# include "../src/windows.hpp" +#else # include # include #endif diff --git a/src/encoder.hpp b/src/encoder.hpp index bd62298..10fe912 100644 --- a/src/encoder.hpp +++ b/src/encoder.hpp @@ -20,6 +20,11 @@ #ifndef __ZMQ_ENCODER_HPP_INCLUDED__ #define __ZMQ_ENCODER_HPP_INCLUDED__ +#include "platform.hpp" +#if defined ZMQ_HAVE_WINDOWS +#include "windows.hpp" +#endif + #include #include #include diff --git a/src/prefix_tree.cpp b/src/prefix_tree.cpp index 441f85d..51225d6 100644 --- a/src/prefix_tree.cpp +++ b/src/prefix_tree.cpp @@ -22,6 +22,11 @@ #include #include +#include "platform.hpp" +#if defined ZMQ_HAVE_WINDOWS +#include "windows.hpp" +#endif + #include "err.hpp" #include "prefix_tree.hpp" diff --git a/src/uuid.cpp b/src/uuid.cpp index 631a625..406bbb4 100644 --- a/src/uuid.cpp +++ b/src/uuid.cpp @@ -17,7 +17,6 @@ along with this program. If not, see . */ -#include "platform.hpp" #include "uuid.hpp" #include "err.hpp" diff --git a/src/uuid.hpp b/src/uuid.hpp index da365ae..871f827 100644 --- a/src/uuid.hpp +++ b/src/uuid.hpp @@ -29,6 +29,7 @@ defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_CYGWIN #include #elif defined ZMQ_HAVE_WINDOWS +#include "windows.hpp" #include #elif defined ZMQ_HAVE_OPENVMS typedef struct diff --git a/src/windows.hpp b/src/windows.hpp index 81c4d38..35024ba 100644 --- a/src/windows.hpp +++ b/src/windows.hpp @@ -23,6 +23,10 @@ // The purpose of this header file is to turn on only the items actually needed // on the windows platform. +#define _WINSOCKAPI_ +#define NOMINMAX +#define _CRT_SECURE_NO_WARNINGS + #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif diff --git a/src/zmq_engine.cpp b/src/zmq_engine.cpp index 8990b48..41b10c8 100644 --- a/src/zmq_engine.cpp +++ b/src/zmq_engine.cpp @@ -17,8 +17,12 @@ along with this program. If not, see . */ -#include +#include "platform.hpp" +#if defined ZMQ_HAVE_WINDOWS +#include "windows.hpp" +#endif +#include #include #include "zmq_engine.hpp" -- cgit v1.2.3