Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-17 08:35:04

0001 /*
0002  * Licensed to the Apache Software Foundation (ASF) under one
0003  * or more contributor license agreements. See the NOTICE file
0004  * distributed with this work for additional information
0005  * regarding copyright ownership. The ASF licenses this file
0006  * to you under the Apache License, Version 2.0 (the
0007  * "License"); you may not use this file except in compliance
0008  * with the License. You may obtain a copy of the License at
0009  *
0010  *   http://www.apache.org/licenses/LICENSE-2.0
0011  *
0012  * Unless required by applicable law or agreed to in writing,
0013  * software distributed under the License is distributed on an
0014  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
0015  * KIND, either express or implied. See the License for the
0016  * specific language governing permissions and limitations
0017  * under the License.
0018  */
0019 
0020 #ifndef _THRIFT_WINDOWS_CONFIG_H_
0021 #define _THRIFT_WINDOWS_CONFIG_H_ 1
0022 
0023 #if defined(_MSC_VER) && (_MSC_VER > 1200)
0024 #pragma once
0025 #endif // _MSC_VER
0026 
0027 #ifndef _WIN32
0028 #error "This is a Windows header only"
0029 #endif
0030 
0031 // Something that defines PRId64 is required to build
0032 #define HAVE_INTTYPES_H 1
0033 
0034 #ifndef _WIN32_WINNT
0035 #define _WIN32_WINNT 0x0601
0036 #endif
0037 
0038 #if defined(_M_IX86) || defined(_M_X64)
0039 #define ARITHMETIC_RIGHT_SHIFT 1
0040 #define SIGNED_RIGHT_SHIFT_IS 1
0041 #endif
0042 
0043 #ifndef __MINGW32__
0044 #pragma warning(disable : 4996) // Deprecated posix name.
0045 #endif
0046 
0047 #define HAVE_GETTIMEOFDAY 1
0048 #define HAVE_SYS_STAT_H 1
0049 
0050 #include <stdint.h>
0051 
0052 #include <thrift/transport/PlatformSocket.h>
0053 #include <thrift/windows/GetTimeOfDay.h>
0054 #include <thrift/windows/Operators.h>
0055 #include <thrift/windows/TWinsockSingleton.h>
0056 #include <thrift/windows/WinFcntl.h>
0057 #include <thrift/windows/SocketPair.h>
0058 
0059 // windows
0060 #include <winsock2.h>
0061 #include <ws2tcpip.h>
0062 
0063 #ifndef __MINGW32__
0064   #ifdef _WIN32_WCE
0065   #pragma comment(lib, "Ws2.lib")
0066   #else
0067   #pragma comment(lib, "Ws2_32.lib")
0068   #pragma comment(lib, "gdi32.lib") // For static OpenSSL
0069   #pragma comment(lib, "crypt32.lib") // For static OpenSSL
0070   #pragma comment(lib, "user32.lib") // For static OpenSSL
0071   #pragma comment(lib, "advapi32.lib") // For security APIs in TPipeServer
0072   #pragma comment(lib, "Shlwapi.lib")  // For StrStrIA in TPipeServer
0073   #endif
0074 #endif // __MINGW32__
0075 
0076 // Replicate the logic of afunix.h on Windows (the header is only present on
0077 // newer Windows SDKs)
0078 #ifdef HAVE_AF_UNIX_H
0079 #include <afunix.h>
0080 #else
0081 #ifndef UNIX_PATH_MAX
0082 #define UNIX_PATH_MAX 108
0083 #endif
0084 typedef struct sockaddr_un {
0085   ADDRESS_FAMILY sun_family;    // AF_UNIX
0086   char sun_path[UNIX_PATH_MAX]; // pathname
0087 } SOCKADDR_UN, *PSOCKADDR_UN;
0088 #endif // HAVE_AF_UNIX_H
0089 
0090 #endif // _THRIFT_WINDOWS_CONFIG_H_