Change libc internal build macro to __is_sortix_libc.

This commit is contained in:
Jonas 'Sortie' Termansen 2013-09-22 23:43:16 +02:00
parent 61d75f39f7
commit 3a30ba57ef
5 changed files with 8 additions and 8 deletions

View File

@ -10,7 +10,7 @@ endif
CPUDIR:=$(CPU)
CPPINCLUDES=-I preproc
CPPFLAGS=-DLIBC_LIBRARY $(CPPINCLUDES)
CPPFLAGS=-D__is_sortix_libc=1 $(CPPINCLUDES)
FLAGS=-Wall -Wextra $(OPTLEVEL)
CFLAGS=-std=gnu99
CXXFLAGS=-std=gnu++11 -fno-exceptions -fno-rtti

View File

@ -52,7 +52,7 @@
#endif
/* Sortix system components implicitly use the native API. */
#if defined(LIBC_LIBRARY) || defined(SORTIX_KERNEL)
#if __is_sortix_libc || defined(SORTIX_KERNEL)
#define _SORTIX_SOURCE 1
#endif
@ -90,7 +90,7 @@
#endif
/* Provide the restrict keyword when building the C library. */
#if !__HAS_RESTRICT && defined(LIBC_LIBRARY)
#if !__HAS_RESTRICT && defined(__is_sortix_libc)
#define restrict __restrict
#undef __HAS_RESTRICT
#define __HAS_RESTRICT 2

View File

@ -32,7 +32,7 @@ __BEGIN_DECLS
/* Only define these constant macros in C++ if requested. */
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) || \
defined(LIBC_LIBRARY) || defined(SORTIX_KERNEL) /* TODO: HACK! */
defined(__is_sortix_libc) || defined(SORTIX_KERNEL) /* TODO: HACK! */
#define INT8_C(c) __INT8_C(c)
#define INT16_C(c) __INT16_C(c)
@ -51,7 +51,7 @@ __BEGIN_DECLS
/* Only define these limit macros in C++ if requested. */
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) || \
defined(LIBC_LIBRARY) || defined(SORTIX_KERNEL) /* TODO: HACK! */
defined(__is_sortix_libc) || defined(SORTIX_KERNEL) /* TODO: HACK! */
#define INT8_MIN __INT8_MIN
#define INT16_MIN __INT16_MIN

View File

@ -177,7 +177,7 @@ int fcloseall(void);
int fshutdown(FILE* fp);
int fpipe(FILE* pipes[2]);
/* Internally used by standard library. */
#if defined(LIBC_LIBRARY)
#if defined(__is_sortix_libc)
extern FILE* _firstfile;
#endif
#endif

View File

@ -57,10 +57,10 @@ typedef int __ssize_t;
typedef __uintptr_t __timer_t;
typedef __SIZE_TYPE__ __socklen_t;
#if defined(SORTIX_KERNEL) || defined(LIBC_LIBRARY)
#if defined(SORTIX_KERNEL) || defined(__is_sortix_libc)
#define OFF_MIN __OFF_MIN
#endif
#if defined(SORTIX_KERNEL) || defined(LIBC_LIBRARY)
#if defined(SORTIX_KERNEL) || defined(__is_sortix_libc)
#define OFF_MAX __OFF_MAX
#endif