Add some random junk to headers to make some things not complain. (You'll get linker errors if you try to use any of it, of course)

This commit is contained in:
nattthebear 2016-03-27 22:00:33 -04:00
parent 776e696e09
commit 82baec8e6b
7 changed files with 36 additions and 7 deletions

View File

@ -0,0 +1,6 @@
#include <ctype.h>
int isascii(int c)
{
return (unsigned)c < 128;
}

View File

@ -93,6 +93,9 @@ int tolower( int c ) _PDCLIB_nothrow;
*/
int toupper( int c ) _PDCLIB_nothrow;
/* returns true for c in [0, 127] */
int isascii(int c) _PDCLIB_nothrow;
#ifdef __cplusplus
}
#endif

View File

@ -78,6 +78,9 @@ struct lconv
/* Time formats (strftime(), wcsftime()) */
#define LC_TIME 4
/* not supported! */
#define LC_MESSAGES 5
/* The category parameter can be any of the LC_* macros to specify if the call
to setlocale() shall affect the entire locale or only a portion thereof.
The category locale specifies which locale should be switched to, with "C"
@ -99,8 +102,9 @@ struct lconv * localeconv( void ) _PDCLIB_nothrow;
#define LC_MONETARY_MASK (1 << LC_MONETARY)
#define LC_NUMERIC_MASK (1 << LC_NUMERIC)
#define LC_TIME_MASK (1 << LC_TIME)
#define LC_MESSAGES_MASK (1 << LC_MESSAGES)
#define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MONETARY_MASK | \
LC_NUMERIC_MASK | LC_TIME_MASK)
LC_NUMERIC_MASK | LC_TIME_MASK | LC_MESSAGES_MASK)
/* POSIX locale type */

View File

@ -77,9 +77,7 @@ wchar_t * wmemchr( const wchar_t * s, wchar_t c, size_t n );
size_t wcslen( const wchar_t * s );
wchar_t * wmemset( wchar_t * s, wchar_t c, size_t n );
#if 0
size_t wcsftime( wchar_t * _PDCLIB_restrict s, size_t maxsize, const wchar_t * _PDCLIB_restrict format, const struct tm * _PDCLIB_restrict timeptr );
#endif
/* Wide character I/O */
int fwprintf( _PDCLIB_file_t * _PDCLIB_restrict stream, const wchar_t * _PDCLIB_restrict format, ... );
@ -118,11 +116,9 @@ int fputws_unlocked( const wchar_t * ws, _PDCLIB_file_t * stream );
/* Wide character <-> Numeric conversions */
/*
double wcstod( const wchar_t * _PDCLIB_restrict nptr, wchar_t * * _PDCLIB_restrict endptr );
float wcstof( const wchar_t * _PDCLIB_restrict nptr, wchar_t * * _PDCLIB_restrict endptr );
long double wcstold( const wchar_t * _PDCLIB_restrict nptr, wchar_t * * _PDCLIB_restrict endptr );
*/
long int wcstol( const wchar_t * _PDCLIB_restrict nptr, wchar_t * * _PDCLIB_restrict endptr, int base );
long long int wcstoll( const wchar_t * _PDCLIB_restrict nptr, wchar_t * * _PDCLIB_restrict endptr, int base );
@ -137,7 +133,9 @@ size_t mbrlen( const char * _PDCLIB_restrict s, size_t n, mbstate_t * _PDCLIB_re
size_t mbrtowc( wchar_t * _PDCLIB_restrict pwc, const char * _PDCLIB_restrict s, size_t n, mbstate_t * _PDCLIB_restrict ps );
size_t wcrtomb( char * _PDCLIB_restrict s, wchar_t wc, mbstate_t * _PDCLIB_restrict ps );
size_t mbsrtowcs( wchar_t * _PDCLIB_restrict dst, const char * * _PDCLIB_restrict src, size_t len, mbstate_t * _PDCLIB_restrict ps );
size_t mbsnrtowcs( wchar_t * _PDCLIB_restrict dst, const char * * _PDCLIB_restrict src, size_t nms, size_t len, mbstate_t * _PDCLIB_restrict ps ); // NYI
size_t wcsrtombs( char * _PDCLIB_restrict dst, const wchar_t * * _PDCLIB_restrict src, size_t len, mbstate_t * _PDCLIB_restrict ps );
size_t wcsnrtombs( char * _PDCLIB_restrict dst, const wchar_t * * _PDCLIB_restrict src, size_t nwc, size_t len, mbstate_t * _PDCLIB_restrict ps ); // NYI
#ifdef __cplusplus
}

View File

@ -306,7 +306,7 @@ typedef char * _PDCLIB_va_list;
/* Locale --------------------------------------------------------------------*/
/* Locale method. See _PDCLIB_locale.h */
/* #define _PDCLIB_LOCALE_METHOD _PDCLIB_LOCALE_METHOD_TSS */
#define _PDCLIB_LOCALE_METHOD _PDCLIB_LOCALE_METHOD_FAKE
/* wchar_t encoding */
#define _PDCLIB_WCHAR_ENCODING _PDCLIB_WCHAR_ENCODING_UCS4

View File

@ -306,6 +306,9 @@ extern char _PDCLIB_Xdigits[];
/* -------------------------------------------------------------------------- */
#if _PDCLIB_C_VERSION >= 2011
#ifdef __cplusplus
#define _Static_assert static_assert
#endif
_Static_assert( sizeof( short ) == _PDCLIB_SHRT_BYTES, "_PDCLIB_SHRT_BYTES incorrectly defined, check _PDCLIB_config.h" );
_Static_assert( sizeof( int ) == _PDCLIB_INT_BYTES, "_PDCLIB_INT_BYTES incorrectly defined, check _PDCLIB_config.h" );
_Static_assert( sizeof( long ) == _PDCLIB_LONG_BYTES, "_PDCLIB_LONG_BYTES incorrectly defined, check _PDCLIB_config.h" );
@ -365,7 +368,7 @@ typedef struct lconv _PDCLIB_lconv_t;
_PDCLIB_size_t _PDCLIB_mb_cur_max( void );
/* wide-character EOF */
#define _PDCLIB_WEOF ((wint_t) -1
#define _PDCLIB_WEOF ((wint_t) -1)
/* -------------------------------------------------------------------------- */
/* stdio */

View File

@ -16,6 +16,7 @@
#define _PDCLIB_LOCALE_METHOD_TSS 't'
#define _PDCLIB_LOCALE_METHOD_THREAD_LOCAL 'T'
#define _PDCLIB_LOCALE_METHOD_FAKE 'F'
#if !defined(_PDCLIB_LOCALE_METHOD)
/* If undefined, no POSIX per thread locales */
@ -50,6 +51,20 @@
{
_PDCLIB_locale_tls = l;
}
#elif _PDCLIB_LOCALE_METHOD == _PDCLIB_LOCALE_METHOD_FAKE
extern locale_t _PDCLIB_locale_fake;
static inline locale_t _PDCLIB_threadlocale( void )
{
locale_t l = _PDCLIB_locale_fake;
if(l == NULL)
l = &_PDCLIB_global_locale;
return l;
}
static inline void _PDCLIB_setthreadlocale( locale_t l )
{
_PDCLIB_locale_fake = l;
}
#else
#error Locale TSS method unspecified
#endif