Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devel/wasi-libc: refresh std{arg,def} headers from LLVM 18
- Loading branch information
Showing
19 changed files
with
458 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/*===---- __stdarg___gnuc_va_list.h - Definition of __gnuc_va_list ---------=== | ||
* | ||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
* See https://llvm.org/LICENSE.txt for license information. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*===-----------------------------------------------------------------------=== | ||
*/ | ||
|
||
#ifndef __GNUC_VA_LIST | ||
#define __GNUC_VA_LIST | ||
typedef __builtin_va_list __gnuc_va_list; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/*===---- __stdarg___va_copy.h - Definition of __va_copy -------------------=== | ||
* | ||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
* See https://llvm.org/LICENSE.txt for license information. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*===-----------------------------------------------------------------------=== | ||
*/ | ||
|
||
#ifndef __va_copy | ||
#define __va_copy(d, s) __builtin_va_copy(d, s) | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/*===---- __stdarg_va_arg.h - Definitions of va_start, va_arg, va_end-------=== | ||
* | ||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
* See https://llvm.org/LICENSE.txt for license information. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*===-----------------------------------------------------------------------=== | ||
*/ | ||
|
||
#ifndef va_arg | ||
|
||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L | ||
/* C23 does not require the second parameter for va_start. */ | ||
#define va_start(ap, ...) __builtin_va_start(ap, 0) | ||
#else | ||
/* Versions before C23 do require the second parameter. */ | ||
#define va_start(ap, param) __builtin_va_start(ap, param) | ||
#endif | ||
#define va_end(ap) __builtin_va_end(ap) | ||
#define va_arg(ap, type) __builtin_va_arg(ap, type) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/*===---- __stdarg_va_copy.h - Definition of va_copy------------------------=== | ||
* | ||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
* See https://llvm.org/LICENSE.txt for license information. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*===-----------------------------------------------------------------------=== | ||
*/ | ||
|
||
#ifndef va_copy | ||
#define va_copy(dest, src) __builtin_va_copy(dest, src) | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/*===---- __stdarg_va_list.h - Definition of va_list -----------------------=== | ||
* | ||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
* See https://llvm.org/LICENSE.txt for license information. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*===-----------------------------------------------------------------------=== | ||
*/ | ||
|
||
#ifndef _VA_LIST | ||
#define _VA_LIST | ||
typedef __builtin_va_list va_list; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/*===---- __stddef_max_align_t.h - Definition of max_align_t ---------------=== | ||
* | ||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
* See https://llvm.org/LICENSE.txt for license information. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*===-----------------------------------------------------------------------=== | ||
*/ | ||
|
||
#ifndef __CLANG_MAX_ALIGN_T_DEFINED | ||
#define __CLANG_MAX_ALIGN_T_DEFINED | ||
|
||
#if defined(_MSC_VER) | ||
typedef double max_align_t; | ||
#elif defined(__APPLE__) | ||
typedef long double max_align_t; | ||
#else | ||
// Define 'max_align_t' to match the GCC definition. | ||
typedef struct { | ||
long long __clang_max_align_nonce1 | ||
__attribute__((__aligned__(__alignof__(long long)))); | ||
long double __clang_max_align_nonce2 | ||
__attribute__((__aligned__(__alignof__(long double)))); | ||
} max_align_t; | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/*===---- __stddef_null.h - Definition of NULL -----------------------------=== | ||
* | ||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
* See https://llvm.org/LICENSE.txt for license information. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*===-----------------------------------------------------------------------=== | ||
*/ | ||
|
||
#if !defined(NULL) || !__building_module(_Builtin_stddef) | ||
|
||
/* linux/stddef.h will define NULL to 0. glibc (and other) headers then define | ||
* __need_NULL and rely on stddef.h to redefine NULL to the correct value again. | ||
* Modules don't support redefining macros like that, but support that pattern | ||
* in the non-modules case. | ||
*/ | ||
#undef NULL | ||
|
||
#ifdef __cplusplus | ||
#if !defined(__MINGW32__) && !defined(_MSC_VER) | ||
#define NULL __null | ||
#else | ||
#define NULL 0 | ||
#endif | ||
#else | ||
#define NULL ((void*)0) | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/*===---- __stddef_nullptr_t.h - Definition of nullptr_t -------------------=== | ||
* | ||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
* See https://llvm.org/LICENSE.txt for license information. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*===-----------------------------------------------------------------------=== | ||
*/ | ||
|
||
/* | ||
* When -fbuiltin-headers-in-system-modules is set this is a non-modular header | ||
* and needs to behave as if it was textual. | ||
*/ | ||
#if !defined(_NULLPTR_T) || \ | ||
(__has_feature(modules) && !__building_module(_Builtin_stddef)) | ||
#define _NULLPTR_T | ||
|
||
#ifdef __cplusplus | ||
#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) | ||
namespace std { | ||
typedef decltype(nullptr) nullptr_t; | ||
} | ||
using ::std::nullptr_t; | ||
#endif | ||
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L | ||
typedef typeof(nullptr) nullptr_t; | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/*===---- __stddef_offsetof.h - Definition of offsetof ---------------------=== | ||
* | ||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
* See https://llvm.org/LICENSE.txt for license information. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*===-----------------------------------------------------------------------=== | ||
*/ | ||
|
||
/* | ||
* When -fbuiltin-headers-in-system-modules is set this is a non-modular header | ||
* and needs to behave as if it was textual. | ||
*/ | ||
#if !defined(offsetof) || \ | ||
(__has_feature(modules) && !__building_module(_Builtin_stddef)) | ||
#define offsetof(t, d) __builtin_offsetof(t, d) | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/*===---- __stddef_ptrdiff_t.h - Definition of ptrdiff_t -------------------=== | ||
* | ||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
* See https://llvm.org/LICENSE.txt for license information. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*===-----------------------------------------------------------------------=== | ||
*/ | ||
|
||
/* | ||
* When -fbuiltin-headers-in-system-modules is set this is a non-modular header | ||
* and needs to behave as if it was textual. | ||
*/ | ||
#if !defined(_PTRDIFF_T) || \ | ||
(__has_feature(modules) && !__building_module(_Builtin_stddef)) | ||
#define _PTRDIFF_T | ||
|
||
typedef __PTRDIFF_TYPE__ ptrdiff_t; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/*===---- __stddef_rsize_t.h - Definition of rsize_t -----------------------=== | ||
* | ||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
* See https://llvm.org/LICENSE.txt for license information. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*===-----------------------------------------------------------------------=== | ||
*/ | ||
|
||
/* | ||
* When -fbuiltin-headers-in-system-modules is set this is a non-modular header | ||
* and needs to behave as if it was textual. | ||
*/ | ||
#if !defined(_RSIZE_T) || \ | ||
(__has_feature(modules) && !__building_module(_Builtin_stddef)) | ||
#define _RSIZE_T | ||
|
||
typedef __SIZE_TYPE__ rsize_t; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/*===---- __stddef_size_t.h - Definition of size_t -------------------------=== | ||
* | ||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
* See https://llvm.org/LICENSE.txt for license information. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*===-----------------------------------------------------------------------=== | ||
*/ | ||
|
||
/* | ||
* When -fbuiltin-headers-in-system-modules is set this is a non-modular header | ||
* and needs to behave as if it was textual. | ||
*/ | ||
#if !defined(_SIZE_T) || \ | ||
(__has_feature(modules) && !__building_module(_Builtin_stddef)) | ||
#define _SIZE_T | ||
|
||
typedef __SIZE_TYPE__ size_t; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/*===---- __stddef_unreachable.h - Definition of unreachable ---------------=== | ||
* | ||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
* See https://llvm.org/LICENSE.txt for license information. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*===-----------------------------------------------------------------------=== | ||
*/ | ||
|
||
/* | ||
* When -fbuiltin-headers-in-system-modules is set this is a non-modular header | ||
* and needs to behave as if it was textual. | ||
*/ | ||
#if !defined(unreachable) || \ | ||
(__has_feature(modules) && !__building_module(_Builtin_stddef)) | ||
#define unreachable() __builtin_unreachable() | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/*===---- __stddef_wchar.h - Definition of wchar_t -------------------------=== | ||
* | ||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
* See https://llvm.org/LICENSE.txt for license information. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*===-----------------------------------------------------------------------=== | ||
*/ | ||
|
||
#if !defined(__cplusplus) || (defined(_MSC_VER) && !_NATIVE_WCHAR_T_DEFINED) | ||
|
||
/* | ||
* When -fbuiltin-headers-in-system-modules is set this is a non-modular header | ||
* and needs to behave as if it was textual. | ||
*/ | ||
#if !defined(_WCHAR_T) || \ | ||
(__has_feature(modules) && !__building_module(_Builtin_stddef)) | ||
#define _WCHAR_T | ||
|
||
#ifdef _MSC_EXTENSIONS | ||
#define _WCHAR_T_DEFINED | ||
#endif | ||
|
||
typedef __WCHAR_TYPE__ wchar_t; | ||
|
||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/*===---- __stddef_wint.h - Definition of wint_t ---------------------------=== | ||
* | ||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
* See https://llvm.org/LICENSE.txt for license information. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*===-----------------------------------------------------------------------=== | ||
*/ | ||
|
||
#ifndef _WINT_T | ||
#define _WINT_T | ||
|
||
typedef __WINT_TYPE__ wint_t; | ||
|
||
#endif |
Oops, something went wrong.