1 // Copyright 2023 The Android Open Source Project
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 
15 #pragma once
16 
17 #ifndef _AEMU_BITS_SOCKET_H_
18 #ifndef __linux__
19 #ifndef __QNX__
20 // Make sure these are defined and don't change anything if used.
21 enum {
22     SOCK_CLOEXEC = 0,
23 #ifndef __APPLE__
24     O_CLOEXEC = 0
25 #endif
26 };
27 #define _AEMU_BITS_SOCKET_H_
28 #endif  // !__QNX__
29 #endif  // !__linux__
30 #endif
31 
32 #ifdef _MSC_VER
33 
34 #include <windows.h>
35 
36 #include <io.h>
37 #include <stdint.h>
38 
39 #include "sys/cdefs.h"
40 
41 __BEGIN_DECLS
42 
43 #include <fcntl.h>
44 #include <limits.h>
45 #include <stdlib.h>
46 #include <strings.h>
47 #include <sys/cdefs.h>
48 #include <sys/stat.h>
49 #include <sys/time.h>
50 #include <sys/types.h>
51 #include <unistd.h>
52 
53 #ifndef fseeko
54 #define fseeko _fseeki64
55 #endif
56 
57 #ifndef ftello
58 #define ftello _ftelli64
59 #endif
60 
61 extern int asprintf(char** buf, const char* format, ...);
62 extern int vasprintf(char** buf, const char* format, va_list args);
63 
64 __END_DECLS
65 
66 #endif