stddef.h revision 8ba179d4a39c79ae486472a5f413f763ffcc0739
18ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman/*===---- stddef.h - Basic type definitions --------------------------------===
28ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman *
38ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman * Copyright (c) 2008 Eli Friedman
48ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman *
58ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman * Permission is hereby granted, free of charge, to any person obtaining a copy
68ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman * of this software and associated documentation files (the "Software"), to deal
78ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman * in the Software without restriction, including without limitation the rights
88ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
98ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman * copies of the Software, and to permit persons to whom the Software is
108ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman * furnished to do so, subject to the following conditions:
118ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman *
128ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman * The above copyright notice and this permission notice shall be included in
138ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman * all copies or substantial portions of the Software.
148ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman *
158ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
168ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
178ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
188ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
198ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
208ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
218ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman * THE SOFTWARE.
228ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman *
238ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman *===-----------------------------------------------------------------------===
248ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman */
258ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman
268ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman#ifndef __STDDEF_H
278ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman#define __STDDEF_H
288ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman
298ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedmantypedef __typeof__(((int*)0)-((int*)0)) ptrdiff_t;
308ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedmantypedef __typeof__(sizeof(int)) size_t;
318ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman#ifndef __cplusplus
328ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedmantypedef __typeof__(*L"") wchar_t;
338ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman#endif
348ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman
358ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman#define NULL ((void*)0)
368ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman#define offsetof(t, d) __builtin_offsetof(t, d)
378ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman
388ba179d4a39c79ae486472a5f413f763ffcc0739Eli Friedman#endif /* __STDDEF_H */
39