1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html><head><meta http-equiv=
"Content-Type" content=
"text/html;charset=UTF-8">
3 <title>Native Client: nacl/nptypes.h Source File
</title>
4 <link href=
"doxygen.css" rel=
"stylesheet" type=
"text/css">
5 <link href=
"tabs.css" rel=
"stylesheet" type=
"text/css">
7 <!-- Generated by Doxygen 1.5.7.1 -->
8 <div class=
"navigation" id=
"top">
11 <li><a href=
"index.html"><span>Main
Page
</span></a></li>
12 <li><a href=
"modules.html"><span>Modules
</span></a></li>
13 <li><a href=
"annotated.html"><span>Data
Structures
</span></a></li>
14 <li class=
"current"><a href=
"files.html"><span>Files
</span></a></li>
19 <li><a href=
"files.html"><span>File
List
</span></a></li>
20 <li><a href=
"globals.html"><span>Globals
</span></a></li>
23 <h1>nacl/nptypes.h
</h1><div class=
"fragment"><pre class=
"fragment"><a name=
"l00001"></a>00001 <span class=
"comment">/* -*- Mode: C; tab-width:
2; indent-tabs-mode: nil; c-basic-offset:
2 -*- */
</span>
24 <a name=
"l00002"></a>00002 <span class=
"comment">/* ***** BEGIN LICENSE BLOCK *****
</span>
25 <a name=
"l00003"></a>00003 <span class=
"comment"> * Version: MPL
1.1/GPL
2.0/LGPL
2.1</span>
26 <a name=
"l00004"></a>00004 <span class=
"comment"> *
</span>
27 <a name=
"l00005"></a>00005 <span class=
"comment"> * The contents of this file are subject to the Mozilla Public License Version
</span>
28 <a name=
"l00006"></a>00006 <span class=
"comment"> *
1.1 (the
"License"); you may not use this file except in compliance with
</span>
29 <a name=
"l00007"></a>00007 <span class=
"comment"> * the License. You may obtain a copy of the License at
</span>
30 <a name=
"l00008"></a>00008 <span class=
"comment"> * http://www.mozilla.org/MPL/
</span>
31 <a name=
"l00009"></a>00009 <span class=
"comment"> *
</span>
32 <a name=
"l00010"></a>00010 <span class=
"comment"> * Software distributed under the License is distributed on an
"AS IS" basis,
</span>
33 <a name=
"l00011"></a>00011 <span class=
"comment"> * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
</span>
34 <a name=
"l00012"></a>00012 <span class=
"comment"> * for the specific language governing rights and limitations under the
</span>
35 <a name=
"l00013"></a>00013 <span class=
"comment"> * License.
</span>
36 <a name=
"l00014"></a>00014 <span class=
"comment"> *
</span>
37 <a name=
"l00015"></a>00015 <span class=
"comment"> * The Original Code is mozilla.org code.
</span>
38 <a name=
"l00016"></a>00016 <span class=
"comment"> *
</span>
39 <a name=
"l00017"></a>00017 <span class=
"comment"> * The Initial Developer of the Original Code is
</span>
40 <a name=
"l00018"></a>00018 <span class=
"comment"> * mozilla.org.
</span>
41 <a name=
"l00019"></a>00019 <span class=
"comment"> * Portions created by the Initial Developer are Copyright (C)
2004</span>
42 <a name=
"l00020"></a>00020 <span class=
"comment"> * the Initial Developer. All Rights Reserved.
</span>
43 <a name=
"l00021"></a>00021 <span class=
"comment"> *
</span>
44 <a name=
"l00022"></a>00022 <span class=
"comment"> * Contributor(s):
</span>
45 <a name=
"l00023"></a>00023 <span class=
"comment"> * Johnny Stenback
<jst@mozilla.org
> (Original author)
</span>
46 <a name=
"l00024"></a>00024 <span class=
"comment"> *
</span>
47 <a name=
"l00025"></a>00025 <span class=
"comment"> * Alternatively, the contents of this file may be used under the terms of
</span>
48 <a name=
"l00026"></a>00026 <span class=
"comment"> * either the GNU General Public License Version
2 or later (the
"GPL"), or
</span>
49 <a name=
"l00027"></a>00027 <span class=
"comment"> * the GNU Lesser General Public License Version
2.1 or later (the
"LGPL"),
</span>
50 <a name=
"l00028"></a>00028 <span class=
"comment"> * in which case the provisions of the GPL or the LGPL are applicable instead
</span>
51 <a name=
"l00029"></a>00029 <span class=
"comment"> * of those above. If you wish to allow use of your version of this file only
</span>
52 <a name=
"l00030"></a>00030 <span class=
"comment"> * under the terms of either the GPL or the LGPL, and not to allow others to
</span>
53 <a name=
"l00031"></a>00031 <span class=
"comment"> * use your version of this file under the terms of the MPL, indicate your
</span>
54 <a name=
"l00032"></a>00032 <span class=
"comment"> * decision by deleting the provisions above and replace them with the notice
</span>
55 <a name=
"l00033"></a>00033 <span class=
"comment"> * and other provisions required by the GPL or the LGPL. If you do not delete
</span>
56 <a name=
"l00034"></a>00034 <span class=
"comment"> * the provisions above, a recipient may use your version of this file under
</span>
57 <a name=
"l00035"></a>00035 <span class=
"comment"> * the terms of any one of the MPL, the GPL or the LGPL.
</span>
58 <a name=
"l00036"></a>00036 <span class=
"comment"> *
</span>
59 <a name=
"l00037"></a>00037 <span class=
"comment"> * ***** END LICENSE BLOCK ***** */
</span>
60 <a name=
"l00038"></a>00038
61 <a name=
"l00039"></a>00039 <span class=
"comment">/*
</span>
62 <a name=
"l00040"></a>00040 <span class=
"comment"> * Header file for ensuring that C99 types ([u]int32_t and bool) are
</span>
63 <a name=
"l00041"></a>00041 <span class=
"comment"> * available.
</span>
64 <a name=
"l00042"></a>00042 <span class=
"comment"> */
</span>
65 <a name=
"l00043"></a>00043
66 <a name=
"l00044"></a>00044 <span class=
"preprocessor">#if defined(WIN32) || defined(OS2)
</span>
67 <a name=
"l00045"></a>00045 <span class=
"preprocessor"></span> <span class=
"comment">/*
</span>
68 <a name=
"l00046"></a>00046 <span class=
"comment"> * Win32 and OS/
2 don't know C99, so define [u]int_16/
32 here. The bool
</span>
69 <a name=
"l00047"></a>00047 <span class=
"comment"> * is predefined tho, both in C and C++.
</span>
70 <a name=
"l00048"></a>00048 <span class=
"comment"> */
</span>
71 <a name=
"l00049"></a>00049 <span class=
"keyword">typedef
</span> <span class=
"keywordtype">short
</span> int16_t;
72 <a name=
"l00050"></a>00050 <span class=
"keyword">typedef
</span> <span class=
"keywordtype">unsigned
</span> <span class=
"keywordtype">short
</span> uint16_t;
73 <a name=
"l00051"></a>00051 <span class=
"keyword">typedef
</span> <span class=
"keywordtype">int
</span> int32_t;
74 <a name=
"l00052"></a>00052 <span class=
"keyword">typedef
</span> <span class=
"keywordtype">unsigned
</span> <span class=
"keywordtype">int
</span> uint32_t;
75 <a name=
"l00053"></a>00053 <span class=
"preprocessor">#elif defined(_AIX) || defined(__sun) || defined(__osf__) || defined(IRIX) || defined(HPUX)
</span>
76 <a name=
"l00054"></a>00054 <span class=
"preprocessor"></span> <span class=
"comment">/*
</span>
77 <a name=
"l00055"></a>00055 <span class=
"comment"> * AIX and SunOS ship a inttypes.h header that defines [u]int32_t,
</span>
78 <a name=
"l00056"></a>00056 <span class=
"comment"> * but not bool for C.
</span>
79 <a name=
"l00057"></a>00057 <span class=
"comment"> */
</span>
80 <a name=
"l00058"></a>00058 <span class=
"preprocessor"> #include
<inttypes.h
></span>
81 <a name=
"l00059"></a>00059
82 <a name=
"l00060"></a>00060 <span class=
"preprocessor"> #ifndef __cplusplus
</span>
83 <a name=
"l00061"></a>00061 <span class=
"preprocessor"></span> <span class=
"keyword">typedef
</span> <span class=
"keywordtype">int
</span> bool;
84 <a name=
"l00062"></a>00062 <span class=
"preprocessor"> #endif
</span>
85 <a name=
"l00063"></a>00063 <span class=
"preprocessor"></span><span class=
"preprocessor">#elif defined(bsdi) || defined(FREEBSD) || defined(OPENBSD)
</span>
86 <a name=
"l00064"></a>00064 <span class=
"preprocessor"></span> <span class=
"comment">/*
</span>
87 <a name=
"l00065"></a>00065 <span class=
"comment"> * BSD/OS, FreeBSD, and OpenBSD ship sys/types.h that define int32_t and
</span>
88 <a name=
"l00066"></a>00066 <span class=
"comment"> * u_int32_t.
</span>
89 <a name=
"l00067"></a>00067 <span class=
"comment"> */
</span>
90 <a name=
"l00068"></a>00068 <span class=
"preprocessor"> #include
<sys/types.h
></span>
91 <a name=
"l00069"></a>00069
92 <a name=
"l00070"></a>00070 <span class=
"comment">/*
</span>
93 <a name=
"l00071"></a>00071 <span class=
"comment"> * BSD/OS ships no header that defines uint32_t, nor bool (for C)
</span>
94 <a name=
"l00072"></a>00072 <span class=
"comment"> */
</span>
95 <a name=
"l00073"></a>00073 <span class=
"preprocessor"> #if defined(bsdi)
</span>
96 <a name=
"l00074"></a>00074 <span class=
"preprocessor"></span> <span class=
"keyword">typedef
</span> u_int32_t uint32_t;
97 <a name=
"l00075"></a>00075
98 <a name=
"l00076"></a>00076 <span class=
"preprocessor"> #if !defined(__cplusplus)
</span>
99 <a name=
"l00077"></a>00077 <span class=
"preprocessor"></span> <span class=
"keyword">typedef
</span> <span class=
"keywordtype">int
</span> bool;
100 <a name=
"l00078"></a>00078 <span class=
"preprocessor"> #endif
</span>
101 <a name=
"l00079"></a>00079 <span class=
"preprocessor"></span><span class=
"preprocessor"> #else
</span>
102 <a name=
"l00080"></a>00080 <span class=
"preprocessor"></span> <span class=
"comment">/*
</span>
103 <a name=
"l00081"></a>00081 <span class=
"comment"> * FreeBSD and OpenBSD define uint32_t and bool.
</span>
104 <a name=
"l00082"></a>00082 <span class=
"comment"> */
</span>
105 <a name=
"l00083"></a>00083 <span class=
"preprocessor"> #include
<inttypes.h
></span>
106 <a name=
"l00084"></a>00084 <span class=
"preprocessor"> #include
<stdbool.h
></span>
107 <a name=
"l00085"></a>00085 <span class=
"preprocessor"> #endif
</span>
108 <a name=
"l00086"></a>00086 <span class=
"preprocessor"></span><span class=
"preprocessor">#elif defined(BEOS)
</span>
109 <a name=
"l00087"></a>00087 <span class=
"preprocessor"></span><span class=
"preprocessor"> #include
<inttypes.h
></span>
110 <a name=
"l00088"></a>00088 <span class=
"preprocessor">#else
</span>
111 <a name=
"l00089"></a>00089 <span class=
"preprocessor"></span> <span class=
"comment">/*
</span>
112 <a name=
"l00090"></a>00090 <span class=
"comment"> * For those that ship a standard C99 stdint.h header file, include
</span>
113 <a name=
"l00091"></a>00091 <span class=
"comment"> * it. Can't do the same for stdbool.h tho, since some systems ship
</span>
114 <a name=
"l00092"></a>00092 <span class=
"comment"> * with a stdbool.h file that doesn't compile!
</span>
115 <a name=
"l00093"></a>00093 <span class=
"comment"> */
</span>
116 <a name=
"l00094"></a>00094 <span class=
"preprocessor"> #include
<stdint.h
></span>
117 <a name=
"l00095"></a>00095
118 <a name=
"l00096"></a>00096 <span class=
"preprocessor"> #ifndef __cplusplus
</span>
119 <a name=
"l00097"></a>00097 <span class=
"preprocessor"></span><span class=
"preprocessor"> #if !defined(__GNUC__) || (__GNUC__
> 2 || __GNUC_MINOR__
> 95)
</span>
120 <a name=
"l00098"></a>00098 <span class=
"preprocessor"></span><span class=
"preprocessor"> #include
<stdbool.h
></span>
121 <a name=
"l00099"></a>00099 <span class=
"preprocessor"> #else
</span>
122 <a name=
"l00100"></a>00100 <span class=
"preprocessor"></span> <span class=
"comment">/*
</span>
123 <a name=
"l00101"></a>00101 <span class=
"comment"> * GCC
2.91 can't deal with a typedef for bool, but a #define
</span>
124 <a name=
"l00102"></a>00102 <span class=
"comment"> * works.
</span>
125 <a name=
"l00103"></a>00103 <span class=
"comment"> */
</span>
126 <a name=
"l00104"></a>00104 <span class=
"preprocessor"> #define bool int
</span>
127 <a name=
"l00105"></a>00105 <span class=
"preprocessor"></span><span class=
"preprocessor"> #endif
</span>
128 <a name=
"l00106"></a>00106 <span class=
"preprocessor"></span><span class=
"preprocessor"> #endif
</span>
129 <a name=
"l00107"></a>00107 <span class=
"preprocessor"></span><span class=
"preprocessor">#endif
</span>
131 <hr size=
"1"><address style=
"text-align: right;"><small>Generated on Mon Dec
22 15:
17:
20 2008 for Native Client by
132 <a href=
"http://www.doxygen.org/index.html">
133 <img src=
"doxygen.png" alt=
"doxygen" align=
"middle" border=
"0"></a> 1.5.7.1 </small></address>