libc: Add default strerror that is not threadsafe. Move threadsafe unix load to the end of the file so that malloc is defined.

db4
Doug Coleman 2014-07-04 03:31:11 -07:00
parent dbba9f931b
commit 451a621dad
1 changed files with 9 additions and 3 deletions

View File

@ -9,9 +9,6 @@ IN: libc
HOOK: strerror os ( errno -- str )
! For strerror on Unix all platforms
<< os windows? [ "libc.unix" require ] unless >>
! For libc.linux, libc.windows, libc.macosx...
<< "libc." os unparse append require >>
@ -43,6 +40,12 @@ FUNCTION-ALIAS: (free)
FUNCTION-ALIAS: (realloc)
void* realloc ( void* alien, size_t size ) ;
FUNCTION-ALIAS: strerror_unsafe
char* strerror ( int errno ) ;
! Add a default strerror even though it's not threadsafe
M: object strerror strerror_unsafe ;
FUNCTION: int strerror_r ( int errno, char* buf, size_t buflen ) ;
ERROR: libc-error errno message ;
@ -121,3 +124,6 @@ FUNCTION: int system ( c-string command ) ;
DESTRUCTOR: free
DESTRUCTOR: (free)
! For strerror on Unix all platforms
<< os windows? [ "libc.unix" require ] unless >>