mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[libc] Update errno and strto* files for compatibility
Most of the strto* functions are only stubbed out, but they're there for things that link to them but don't call them.
This commit is contained in:
10
src/libraries/libc/arch/amd64/errno.cpp
Normal file
10
src/libraries/libc/arch/amd64/errno.cpp
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#include <arch/amd64/errno.h>
|
||||||
|
|
||||||
|
static int errno_value = 0;
|
||||||
|
|
||||||
|
int *
|
||||||
|
__errno_location()
|
||||||
|
{
|
||||||
|
// TODO: thread-local errno
|
||||||
|
return &errno_value;
|
||||||
|
}
|
||||||
@@ -2,4 +2,13 @@
|
|||||||
/// \file arch/amd64/errno.h
|
/// \file arch/amd64/errno.h
|
||||||
/// errno implementation for amd64
|
/// errno implementation for amd64
|
||||||
|
|
||||||
extern int errno;
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int * __errno_location();
|
||||||
|
#define errno (*__errno_location())
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} // extern C
|
||||||
|
#endif
|
||||||
|
|||||||
18
src/libraries/libc/stdlib/strtod.cpp
Normal file
18
src/libraries/libc/stdlib/strtod.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/** \file strtod.cpp
|
||||||
|
*
|
||||||
|
* This file is part of the C standard library for the jsix operating
|
||||||
|
* system.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
double strtod( const char * restrict nptr, char ** restrict endptr )
|
||||||
|
{
|
||||||
|
assert(!"strtod() NYI");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
18
src/libraries/libc/stdlib/strtof.cpp
Normal file
18
src/libraries/libc/stdlib/strtof.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/** \file strtof.cpp
|
||||||
|
*
|
||||||
|
* This file is part of the C standard library for the jsix operating
|
||||||
|
* system.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
float strtof( const char * restrict nptr, char ** restrict endptr )
|
||||||
|
{
|
||||||
|
assert(!"strtof() NYI");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
18
src/libraries/libc/stdlib/strtol.cpp
Normal file
18
src/libraries/libc/stdlib/strtol.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/** \file strtol.cpp
|
||||||
|
*
|
||||||
|
* This file is part of the C standard library for the jsix operating
|
||||||
|
* system.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
long strtol( const char * restrict nptr, char ** restrict endptr, int base )
|
||||||
|
{
|
||||||
|
assert(!"strtol() NYI");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
18
src/libraries/libc/stdlib/strtold.cpp
Normal file
18
src/libraries/libc/stdlib/strtold.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/** \file strtold.cpp
|
||||||
|
*
|
||||||
|
* This file is part of the C standard library for the jsix operating
|
||||||
|
* system.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
long double strtold( const char * restrict nptr, char ** restrict endptr )
|
||||||
|
{
|
||||||
|
assert(!"strtold() NYI");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
18
src/libraries/libc/stdlib/strtoll.cpp
Normal file
18
src/libraries/libc/stdlib/strtoll.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/** \file strtoll.cpp
|
||||||
|
*
|
||||||
|
* This file is part of the C standard library for the jsix operating
|
||||||
|
* system.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
long long strtoll( const char * restrict nptr, char ** restrict endptr, int base )
|
||||||
|
{
|
||||||
|
assert(!"strtoll() NYI");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
18
src/libraries/libc/stdlib/strtoul.cpp
Normal file
18
src/libraries/libc/stdlib/strtoul.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/** \file strtoul.cpp
|
||||||
|
*
|
||||||
|
* This file is part of the C standard library for the jsix operating
|
||||||
|
* system.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
unsigned long strtoul( const char * restrict nptr, char ** restrict endptr, int base )
|
||||||
|
{
|
||||||
|
assert(!"strtoul() NYI");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
18
src/libraries/libc/stdlib/strtoull.cpp
Normal file
18
src/libraries/libc/stdlib/strtoull.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/** \file strtoull.cpp
|
||||||
|
*
|
||||||
|
* This file is part of the C standard library for the jsix operating
|
||||||
|
* system.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
unsigned long long strtoull( const char * restrict nptr, char ** restrict endptr, int base )
|
||||||
|
{
|
||||||
|
assert(!"strtoull() NYI");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -23,3 +23,5 @@ int memcmp(const void *s1, const void *s2, size_t n) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" int bcmp(const void *s1, const void *s2, size_t n)
|
||||||
|
__attribute__ ((weak, alias ("memcmp")));
|
||||||
|
|||||||
18
src/libraries/libc/wchar/swprintf.cpp
Normal file
18
src/libraries/libc/wchar/swprintf.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/** \file swprintf.cpp
|
||||||
|
*
|
||||||
|
* This file is part of the C standard library for the jsix operating
|
||||||
|
* system.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <wchar.h>
|
||||||
|
|
||||||
|
int swprintf(wchar_t * restrict s, size_t n, const wchar_t * restrict format, ...)
|
||||||
|
{
|
||||||
|
assert(!"swprintf() NYI");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
18
src/libraries/libc/wchar/wcslen.cpp
Normal file
18
src/libraries/libc/wchar/wcslen.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/** \file wcslen.cpp
|
||||||
|
*
|
||||||
|
* This file is part of the C standard library for the jsix operating
|
||||||
|
* system.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <wchar.h>
|
||||||
|
|
||||||
|
size_t wcslen(const wchar_t * s)
|
||||||
|
{
|
||||||
|
assert(!"wcslen() NYI");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
18
src/libraries/libc/wchar/wcstod.cpp
Normal file
18
src/libraries/libc/wchar/wcstod.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/** \file wcstod.cpp
|
||||||
|
*
|
||||||
|
* This file is part of the C standard library for the jsix operating
|
||||||
|
* system.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <wchar.h>
|
||||||
|
|
||||||
|
double wcstod(const wchar_t * restrict nptr, wchar_t ** restrict endptr)
|
||||||
|
{
|
||||||
|
assert(!"wcstod() NYI");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
18
src/libraries/libc/wchar/wcstof.cpp
Normal file
18
src/libraries/libc/wchar/wcstof.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/** \file wcstof.cpp
|
||||||
|
*
|
||||||
|
* This file is part of the C standard library for the jsix operating
|
||||||
|
* system.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <wchar.h>
|
||||||
|
|
||||||
|
float wcstof(const wchar_t * restrict nptr, wchar_t ** restrict endptr)
|
||||||
|
{
|
||||||
|
assert(!"wcstof() NYI");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
18
src/libraries/libc/wchar/wcstol.cpp
Normal file
18
src/libraries/libc/wchar/wcstol.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/** \file wcstol.cpp
|
||||||
|
*
|
||||||
|
* This file is part of the C standard library for the jsix operating
|
||||||
|
* system.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <wchar.h>
|
||||||
|
|
||||||
|
long wcstol(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base)
|
||||||
|
{
|
||||||
|
assert(!"wcstol() NYI");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
18
src/libraries/libc/wchar/wcstold.cpp
Normal file
18
src/libraries/libc/wchar/wcstold.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/** \file wcstold.cpp
|
||||||
|
*
|
||||||
|
* This file is part of the C standard library for the jsix operating
|
||||||
|
* system.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <wchar.h>
|
||||||
|
|
||||||
|
long double wcstold(const wchar_t * restrict nptr, wchar_t ** restrict endptr)
|
||||||
|
{
|
||||||
|
assert(!"wcstold() NYI");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
18
src/libraries/libc/wchar/wcstoll.cpp
Normal file
18
src/libraries/libc/wchar/wcstoll.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/** \file wcstoll.cpp
|
||||||
|
*
|
||||||
|
* This file is part of the C standard library for the jsix operating
|
||||||
|
* system.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <wchar.h>
|
||||||
|
|
||||||
|
long long wcstoll(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base)
|
||||||
|
{
|
||||||
|
assert(!"wcstoll() NYI");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
18
src/libraries/libc/wchar/wcstoul.cpp
Normal file
18
src/libraries/libc/wchar/wcstoul.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/** \file wcstoul.cpp
|
||||||
|
*
|
||||||
|
* This file is part of the C standard library for the jsix operating
|
||||||
|
* system.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <wchar.h>
|
||||||
|
|
||||||
|
unsigned long wcstoul(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base)
|
||||||
|
{
|
||||||
|
assert(!"wcstoul() NYI");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
18
src/libraries/libc/wchar/wcstoull.cpp
Normal file
18
src/libraries/libc/wchar/wcstoull.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/** \file wcstoull.cpp
|
||||||
|
*
|
||||||
|
* This file is part of the C standard library for the jsix operating
|
||||||
|
* system.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <wchar.h>
|
||||||
|
|
||||||
|
unsigned long long wcstoull(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base)
|
||||||
|
{
|
||||||
|
assert(!"wcstoull() NYI");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
18
src/libraries/libc/wchar/wmemchr.cpp
Normal file
18
src/libraries/libc/wchar/wmemchr.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/** \file wmemchr.cpp
|
||||||
|
*
|
||||||
|
* This file is part of the C standard library for the jsix operating
|
||||||
|
* system.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <wchar.h>
|
||||||
|
|
||||||
|
wchar_t * wmemchr(const wchar_t * s, wchar_t c, size_t n)
|
||||||
|
{
|
||||||
|
assert(!"wmemchr() NYI");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
18
src/libraries/libc/wchar/wmememp.cpp
Normal file
18
src/libraries/libc/wchar/wmememp.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/** \file wmemcmp.cpp
|
||||||
|
*
|
||||||
|
* This file is part of the C standard library for the jsix operating
|
||||||
|
* system.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <wchar.h>
|
||||||
|
|
||||||
|
int wmemcmp(const wchar_t * s1, const wchar_t * s2, size_t n)
|
||||||
|
{
|
||||||
|
assert(!"wmemcmp() NYI");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user