Remove conditional libc macros in libmaxsi.

This commit is contained in:
Jonas 'Sortie' Termansen 2012-09-21 23:33:46 +02:00
parent b293fb3171
commit afafea577a
2 changed files with 3 additions and 23 deletions

View File

@ -47,22 +47,9 @@
// Libmaxsi is also compatible as a C library, if enabled.
#ifdef LIBMAXSI_LIBRARY
#if defined(SORTIX_KERNEL) && !defined(LIBMAXSI_NO_LIBC)
#define LIBMAXSI_NO_LIBC
#endif
#ifndef LIBMAXSI_NO_LIBC
#define LIBMAXSI_LIBC
#endif
#ifdef LIBMAXSI_LIBC
#define DUAL_FUNCTION(Type, CName, LibMaxsiName, Parameters) \
Type LibMaxsiName Parameters __attribute__ ((weak, alias (#CName))); \
extern "C" Type CName Parameters
#else
#define DUAL_FUNCTION(Type, CName, LibMaxsiName, Parameters) \
Type LibMaxsiName Parameters
#endif
#define DUAL_FUNCTION(Type, CName, LibMaxsiName, Parameters) \
Type LibMaxsiName Parameters __attribute__ ((weak, alias (#CName))); \
extern "C" Type CName Parameters
#endif
#if !defined(SORTIX_KERNEL) && !defined(ASSERT)

View File

@ -23,9 +23,7 @@
******************************************************************************/
#include <libmaxsi/platform.h>
#ifdef LIBMAXSI_LIBC
#include <sys/types.h>
#endif
#include <libmaxsi/syscall.h>
#include <libmaxsi/thread.h>
@ -58,9 +56,7 @@ namespace Maxsi
return SysCreate(&ThreadStartup, Start, Parameter, StackSize);
}
#ifdef LIBMAXSI_LIBC
extern "C" unsigned sleep(unsigned Seconds) { SysSleep(Seconds); return 0; }
#endif
// TODO: Thinking about it, there is no need for this to be a long.
// Sortix will never run for that long time, and shouldn't it be unsigned long?
@ -69,10 +65,7 @@ namespace Maxsi
SysSleep(Seconds);
}
#ifdef LIBMAXSI_LIBC
extern "C" int usleep(useconds_t Microseconds) { SysUSleep(Microseconds); return 0; }
#endif
void USleep(long Microseconds)
{