GRPC C++  1.62.0
port.h
Go to the documentation of this file.
1 // Copyright 2021 The gRPC Authors
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 #ifndef GRPC_EVENT_ENGINE_PORT_H
15 #define GRPC_EVENT_ENGINE_PORT_H
16 
18 
19 // Platform-specific sockaddr includes
20 #if defined(GPR_ANDROID) || defined(GPR_LINUX) || defined(GPR_APPLE) || \
21  defined(GPR_FREEBSD) || defined(GPR_OPENBSD) || defined(GPR_SOLARIS) || \
22  defined(GPR_AIX) || defined(GPR_NACL) || defined(GPR_FUCHSIA) || \
23  defined(GRPC_POSIX_SOCKET) || defined(GPR_NETBSD)
24 #define GRPC_EVENT_ENGINE_POSIX
25 #include <arpa/inet.h>
26 #include <netdb.h>
27 #include <netinet/in.h>
28 #include <sys/socket.h>
29 #include <unistd.h>
30 #elif defined(GPR_WINDOWS)
31 #include <winsock2.h>
32 #include <ws2tcpip.h>
33 // must be included after the above
34 #include <mswsock.h>
35 #else
36 #error UNKNOWN PLATFORM
37 #endif
38 
39 #endif // GRPC_EVENT_ENGINE_PORT_H
port_platform.h