c++: Update minimal libc headers
Updates the minimal libc headers for differences between the C and C++ languages. This includes ... 1. Conditionally defining "bool", "true" and "false" as they are already keywords in C++. 2. Making the definition of NULL language dependent. 3. Using the _Restrict macro instead of the restrict keyword as restrict exists in C, but not in C++. 4. Changing the definition of size_t so that it is compatible with what the compiler expects when building the new operator stubs (as it varies by architecture). Change-Id: I37ff058a60b90a05f96e9dd6f61d454d143041ce Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
This commit is contained in:
parent
497d0e53c4
commit
df3c6b13ab
10 changed files with 79 additions and 29 deletions
|
@ -37,7 +37,7 @@ static int sprintf_out(int c, struct emitter *p)
|
|||
return 0; /* indicate keep going so we get the total count */
|
||||
}
|
||||
|
||||
int snprintf(char *restrict s, size_t len, const char *restrict format, ...)
|
||||
int snprintf(char *_Restrict s, size_t len, const char *_Restrict format, ...)
|
||||
{
|
||||
va_list vargs;
|
||||
|
||||
|
@ -64,7 +64,7 @@ int snprintf(char *restrict s, size_t len, const char *restrict format, ...)
|
|||
return r;
|
||||
}
|
||||
|
||||
int sprintf(char *restrict s, const char *restrict format, ...)
|
||||
int sprintf(char *_Restrict s, const char *_Restrict format, ...)
|
||||
{
|
||||
va_list vargs;
|
||||
|
||||
|
@ -82,7 +82,7 @@ int sprintf(char *restrict s, const char *restrict format, ...)
|
|||
return r;
|
||||
}
|
||||
|
||||
int vsnprintf(char *restrict s, size_t len, const char *restrict format, va_list vargs)
|
||||
int vsnprintf(char *_Restrict s, size_t len, const char *_Restrict format, va_list vargs)
|
||||
{
|
||||
struct emitter p;
|
||||
int r;
|
||||
|
@ -105,7 +105,7 @@ int vsnprintf(char *restrict s, size_t len, const char *restrict format, va_list
|
|||
return r;
|
||||
}
|
||||
|
||||
int vsprintf(char *restrict s, const char *restrict format, va_list vargs)
|
||||
int vsprintf(char *_Restrict s, const char *_Restrict format, va_list vargs)
|
||||
{
|
||||
struct emitter p;
|
||||
int r;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue