blob: 0555e079f37c12176cba23b48f73734867a496e0 [file] [log] [blame]
Roger Meier84e4a3c2011-09-16 20:58:44 +00001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#ifndef _THRIFT_WINDOWS_CONFIG_H_
21#define _THRIFT_WINDOWS_CONFIG_H_ 1
22
23#if defined(_MSC_VER) && (_MSC_VER > 1200)
24#pragma once
25#endif // _MSC_VER
26
27#ifndef _WIN32
28#error This is a MSVC header only.
29#endif
30
Carl Yeksigian7cb7fc82013-06-07 07:33:01 -040031// use std::thread in MSVC11 (2012) or newer
32#if _MSC_VER >= 1700
33# define USE_STD_THREAD 1
34// otherwise use boost threads
35#else
36# define USE_BOOST_THREAD 1
37#endif
38
39#ifndef TARGET_WIN_XP
40# define TARGET_WIN_XP 1
41#endif
42
43#if TARGET_WIN_XP
44# ifndef WINVER
45# define WINVER 0x0501
46# endif
47# ifndef _WIN32_WINNT
48# define _WIN32_WINNT 0x0501
49# endif
50#endif
51
52#ifndef _WIN32_WINNT
53# define _WIN32_WINNT 0x0601
54#endif
55
56#pragma warning(disable: 4996) // Deprecated posix name.
Roger Meier8cd3b1a2011-09-23 14:25:22 +000057
Jake Farrell6fcecd42012-10-11 20:34:25 +000058#define VERSION "1.0.0-dev"
Roger Meier8cd3b1a2011-09-23 14:25:22 +000059#define HAVE_GETTIMEOFDAY 1
Roger Meier3faaedf2011-10-02 10:51:45 +000060#define HAVE_SYS_STAT_H 1
Roger Meier8cd3b1a2011-09-23 14:25:22 +000061
Carl Yeksigian7cb7fc82013-06-07 07:33:01 -040062#ifdef HAVE_STDINT_H
63# include <stdint.h>
64#else
65# include <boost/cstdint.hpp>
66
67typedef boost::int64_t int64_t;
68typedef boost::uint64_t uint64_t;
69typedef boost::int32_t int32_t;
70typedef boost::uint32_t uint32_t;
71typedef boost::int16_t int16_t;
72typedef boost::uint16_t uint16_t;
73typedef boost::int8_t int8_t;
74typedef boost::uint8_t uint8_t;
75#endif
76
77#include <thrift/transport/PlatformSocket.h>
Roger Meier4285ba22013-06-10 21:17:23 +020078#include <thrift/windows/GetTimeOfDay.h>
79#include <thrift/windows/Operators.h>
80#include <thrift/windows/TWinsockSingleton.h>
81#include <thrift/windows/WinFcntl.h>
82#include <thrift/windows/SocketPair.h>
Roger Meier84e4a3c2011-09-16 20:58:44 +000083
Roger Meier84e4a3c2011-09-16 20:58:44 +000084// windows
85#include <Winsock2.h>
86#include <ws2tcpip.h>
87#pragma comment(lib, "Ws2_32.lib")
Roger Meierd1bf5d02012-04-11 21:38:56 +000088#pragma comment(lib, "advapi32.lib") //For security APIs in TPipeServer
Roger Meier84e4a3c2011-09-16 20:58:44 +000089
Roger Meier84e4a3c2011-09-16 20:58:44 +000090#endif // _THRIFT_WINDOWS_CONFIG_H_