Sync with 5.4.0
[deliverable/titan.core.git] / common / platform.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2015 Ericsson Telecom AB
3 // All rights reserved. This program and the accompanying materials
4 // are made available under the terms of the Eclipse Public License v1.0
5 // which accompanies this distribution, and is available at
6 // http://www.eclipse.org/legal/epl-v10.html
7 ///////////////////////////////////////////////////////////////////////////////
8 #ifndef PLATFORM_H_
9 #define PLATFORM_H_
10
11 #include <sys/socket.h>
12
13 /* Create a unified alias for socklen_t */
14
15 #if defined(SOLARIS)
16 /* Has no socklen_t at all, man page claims to use size_t. However, size_t
17 * 1. is slightly broken, see
18 * http://portabilityblog.com/blog/archives/7-socklen_t-confusion.html
19 * 2. is used _only_ if _XPG4_2 is defined.
20 * Since TITAN does not define _XPG4_2, the correct socklen_type is int. */
21 typedef int socklen_type;
22 #elif defined(WIN32)
23 /* Cygwin has socklen_t which is a typedef to int */
24 typedef socklen_t socklen_type;
25 #else
26 /* Modern socklen_t is typedef unsigned int32 */
27 typedef socklen_t socklen_type;
28 #endif /* defined... */
29
30 #endif /* PLATFORM_H_ */
This page took 0.03084 seconds and 5 git commands to generate.