Roger Meier | 84e4a3c | 2011-09-16 20:58:44 +0000 | [diff] [blame] | 1 | /* |
| 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 |
James E. King, III | 4d39ac5 | 2016-09-28 11:03:27 -0400 | [diff] [blame] | 28 | #error "This is a Windows header only" |
Roger Meier | 84e4a3c | 2011-09-16 20:58:44 +0000 | [diff] [blame] | 29 | #endif |
| 30 | |
James E. King, III | 7edc8fa | 2017-01-20 10:11:41 -0500 | [diff] [blame] | 31 | // Something that defines PRId64 is required to build |
| 32 | #define HAVE_INTTYPES_H 1 |
| 33 | |
Carl Yeksigian | 7cb7fc8 | 2013-06-07 07:33:01 -0400 | [diff] [blame] | 34 | #ifndef _WIN32_WINNT |
Konrad Grochowski | 16a23a6 | 2014-11-13 15:33:38 +0100 | [diff] [blame] | 35 | #define _WIN32_WINNT 0x0601 |
Carl Yeksigian | 7cb7fc8 | 2013-06-07 07:33:01 -0400 | [diff] [blame] | 36 | #endif |
| 37 | |
Roger Meier | f83c0e1 | 2014-07-07 22:06:45 +0200 | [diff] [blame] | 38 | #if defined(_M_IX86) || defined(_M_X64) |
Konrad Grochowski | 16a23a6 | 2014-11-13 15:33:38 +0100 | [diff] [blame] | 39 | #define ARITHMETIC_RIGHT_SHIFT 1 |
| 40 | #define SIGNED_RIGHT_SHIFT_IS 1 |
Roger Meier | f83c0e1 | 2014-07-07 22:06:45 +0200 | [diff] [blame] | 41 | #endif |
| 42 | |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 43 | #ifndef __MINGW32__ |
Konrad Grochowski | 16a23a6 | 2014-11-13 15:33:38 +0100 | [diff] [blame] | 44 | #pragma warning(disable : 4996) // Deprecated posix name. |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 45 | #endif |
Roger Meier | 8cd3b1a | 2011-09-23 14:25:22 +0000 | [diff] [blame] | 46 | |
| 47 | #define HAVE_GETTIMEOFDAY 1 |
Roger Meier | 3faaedf | 2011-10-02 10:51:45 +0000 | [diff] [blame] | 48 | #define HAVE_SYS_STAT_H 1 |
Roger Meier | 8cd3b1a | 2011-09-23 14:25:22 +0000 | [diff] [blame] | 49 | |
Konrad Grochowski | 16a23a6 | 2014-11-13 15:33:38 +0100 | [diff] [blame] | 50 | #include <stdint.h> |
Carl Yeksigian | 7cb7fc8 | 2013-06-07 07:33:01 -0400 | [diff] [blame] | 51 | |
| 52 | #include <thrift/transport/PlatformSocket.h> |
Roger Meier | 4285ba2 | 2013-06-10 21:17:23 +0200 | [diff] [blame] | 53 | #include <thrift/windows/GetTimeOfDay.h> |
| 54 | #include <thrift/windows/Operators.h> |
| 55 | #include <thrift/windows/TWinsockSingleton.h> |
| 56 | #include <thrift/windows/WinFcntl.h> |
| 57 | #include <thrift/windows/SocketPair.h> |
Roger Meier | 84e4a3c | 2011-09-16 20:58:44 +0000 | [diff] [blame] | 58 | |
Roger Meier | 84e4a3c | 2011-09-16 20:58:44 +0000 | [diff] [blame] | 59 | // windows |
| 60 | #include <Winsock2.h> |
| 61 | #include <ws2tcpip.h> |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 62 | #ifndef __MINGW32__ |
| 63 | #ifdef _WIN32_WCE |
| 64 | #pragma comment(lib, "Ws2.lib") |
| 65 | #else |
| 66 | #pragma comment(lib, "Ws2_32.lib") |
Mario Emmenlauer | f5a9a30 | 2019-08-22 22:08:16 +0200 | [diff] [blame] | 67 | #pragma comment(lib, "gdi32.lib") // For static OpenSSL |
| 68 | #pragma comment(lib, "crypt32.lib") // For static OpenSSL |
| 69 | #pragma comment(lib, "user32.lib") // For static OpenSSL |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 70 | #pragma comment(lib, "advapi32.lib") // For security APIs in TPipeServer |
| 71 | #pragma comment(lib, "Shlwapi.lib") // For StrStrIA in TPipeServer |
| 72 | #endif |
| 73 | #endif // __MINGW32__ |
| 74 | |
Roger Meier | 84e4a3c | 2011-09-16 20:58:44 +0000 | [diff] [blame] | 75 | #endif // _THRIFT_WINDOWS_CONFIG_H_ |