2 * Copyright 2008, Google Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above
12 * copyright notice, this list of conditions and the following disclaimer
13 * in the documentation and/or other materials provided with the
15 * * Neither the name of Google Inc. nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #ifndef NATIVE_CLIENT_INCLUDE_WIN_PORT_WIN_H_
34 #define NATIVE_CLIENT_INCLUDE_WIN_PORT_WIN_H_
36 #pragma warning( disable : 4255 4668 4820 4826 4619)
37 /* TODO: disabled warnings about Windows-specific secure functions
38 * such as sprintf_s */
39 #pragma warning( disable : 4996)
40 #pragma warning( disable : 4127) /* conditional expression is constant */
42 #include "native_client/include/elf.h"
44 // types missing on Windows
46 //typedef __int64 intptr_t;
47 typedef unsigned int size_t;
49 typedef unsigned int uint32_t;
51 typedef unsigned char uint8_t;
52 typedef unsigned int u_int32_t
;
53 typedef unsigned short __uint16_t
;
54 typedef unsigned short uint16_t;
55 typedef short int16_t;
58 typedef long int __loff_t
;
59 typedef signed char int8_t;
60 typedef unsigned long DWORD
;
62 typedef __int64
int64_t;
63 typedef unsigned __int64
uint64_t;
65 #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
66 /* only what we need so far */
67 # define UINT8_MAX (255)
70 //arguments processing
72 int getopt(int argc
, char *argv
[], char *optstring
);
73 extern char *optarg
; // global argument pointer
74 extern int optind
; // global argv index
77 /*************************** stdio.h ********************/
82 #define NULL ((void *)0)
86 /* Seek method constants */
91 /************************************************************/
93 /* missing from Windows <errno.h> */
94 #define EDQUOT 122 /* Quota exceeded */
102 /* missing from win stdio.h and fcntl.h */
104 /* from bits/fcntl.h */
105 #define O_ACCMODE 0003
107 /* from linux/limits.h, via sys/param.h */
108 #define PATH_MAX 4096
110 #endif /* NATIVE_CLIENT_INCLUDE_WIN_PORT_WIN_H_ */