Version 4.2.0.1, tag libreoffice-4.2.0.1
[LibreOffice.git] / sal / osl / w32 / system.h
blob57a7a0fb6aa4886546f945c07aa0d7a1defedb23
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #if OSL_DEBUG_LEVEL <= 3
21 # define NO_DEBUG_CRT
22 #endif
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <stdarg.h>
27 #include <ctype.h>
28 #include <malloc.h>
29 #include <limits.h>
30 #include <process.h>
31 #include <time.h>
32 #include <fcntl.h>
33 #include <sys/types.h>
34 #include <sys/stat.h>
35 #include <io.h>
36 #include <share.h>
37 #include <direct.h>
39 /* Must define this else build breaks because Winsock2.h
40 includes Windows.h and without WIN32_LEAN_AND_MEAN
41 also includes mswsock.h which needs a forward typedef
42 of SOCKET ...
44 #define WIN32_LEAN_AND_MEAN
46 #ifdef __GNUC__
47 // windows.h includes winsock2.h
48 // if _WIN32_WINNT > 0x0400
49 // so someone cannot include winsock.h
50 // at the same time without patching
51 // windows.h
52 #include <windows.h>
53 #include <winsock2.h>
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 #include <ws2tcpip.h>
58 #ifdef __cplusplus
60 #endif
61 #include <shlobj.h>
62 #ifndef NO_DEBUG_CRT
63 #include <crtdbg.h>
64 #endif
65 #else
66 // winsock2.h includes windows.h
67 #pragma warning(push,1) /* disable warnings within system headers */
68 #pragma warning(disable:4917)
69 #include <winsock2.h>
70 #include <wsipx.h>
71 #include <shlobj.h>
72 #ifndef NO_DEBUG_CRT
73 #include <crtdbg.h>
74 #endif
75 #pragma warning(pop)
76 #endif
78 #ifdef __GNUC__
79 # ifndef SA_FAMILY_DECL
80 # define SA_FAMILY_DECL short sa_family
81 # endif
83 typedef struct sockaddr_ipx {
84 SA_FAMILY_DECL;
85 char sa_netnum[4];
86 char sa_nodenum[6];
87 unsigned short sa_socket;
88 } SOCKADDR_IPX;
90 # define NSPROTO_IPX 1000
91 # define NSPROTO_SPX 1256
92 # define NSPROTO_SPXII 1257
93 #endif // #ifdef __GNUC__
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */