]> sourceware.org Git - newlib-cygwin.git/commitdiff
change _COMPILING_NEWLIB to _LIBC
authorMike Frysinger <vapier@gentoo.org>
Tue, 9 Nov 2021 03:22:27 +0000 (22:22 -0500)
committerMike Frysinger <vapier@gentoo.org>
Tue, 16 Nov 2021 00:32:23 +0000 (19:32 -0500)
Use the same name as glibc & gnulib to indicate "newlib itself is
being compiled".  This also harmonizes the codebase a bit in that
_LIBC was already used in places instead of _COMPILING_NEWLIB.

Building for bfin-elf, mips-elf, and x86_64-pc-cygwin produces
the same object code.

35 files changed:
newlib/configure.host
newlib/libc/include/ctype.h
newlib/libc/include/dirent.h
newlib/libc/include/locale.h
newlib/libc/include/reent.h
newlib/libc/include/stdio.h
newlib/libc/include/sys/_default_fcntl.h
newlib/libc/include/sys/features.h
newlib/libc/include/sys/signal.h
newlib/libc/include/sys/stat.h
newlib/libc/include/sys/time.h
newlib/libc/include/sys/times.h
newlib/libc/include/sys/unistd.h
newlib/libc/include/sys/wait.h
newlib/libc/machine/cris/sys/fcntl.h
newlib/libc/machine/mips/memcpy.S
newlib/libc/machine/mips/memset.S
newlib/libc/machine/mips/strcmp.S
winsup/cygwin/dir.cc
winsup/cygwin/fhandler_cygdrive.cc
winsup/cygwin/fhandler_dev.cc
winsup/cygwin/fhandler_disk_file.cc
winsup/cygwin/fhandler_proc.cc
winsup/cygwin/fhandler_process.cc
winsup/cygwin/fhandler_procsysvipc.cc
winsup/cygwin/fhandler_registry.cc
winsup/cygwin/include/cygwin/config.h
winsup/cygwin/include/cygwin/stat.h
winsup/cygwin/include/cygwin/stdlib.h
winsup/cygwin/include/getopt.h
winsup/cygwin/include/machine/_types.h
winsup/cygwin/include/sys/dirent.h
winsup/cygwin/include/sys/syslimits.h
winsup/cygwin/include/sys/wait.h
winsup/cygwin/math/complex_internal.h

index e737f73f5f75590c258bed5dfd50cdde7e5a631c..c429dde1c3d1b4a7497159e10f7fd83ad8b53f36 100644 (file)
@@ -54,7 +54,7 @@
 #   have_init_fini     have init/fini ("yes" or "no", set to "yes" by default)
 #   noinclude          list of include files to not install
 
-newlib_cflags="-D_COMPILING_NEWLIB"
+newlib_cflags="-D_LIBC"
 libm_machine_dir=
 machine_dir=
 shared_machine_dir=
index 366b35dc9f9dc912cbd210885e8955cf13d2621f..65ab24bf03da149b6eda2ccdfa9b2e47254fb3d6 100644 (file)
@@ -4,7 +4,7 @@
 #include "_ansi.h"
 #include <sys/cdefs.h>
 
-#if __POSIX_VISIBLE >= 200809 || __MISC_VISIBLE || defined (_COMPILING_NEWLIB)
+#if __POSIX_VISIBLE >= 200809 || __MISC_VISIBLE || defined (_LIBC)
 #include <sys/_locale.h>
 #endif
 
index 5d566a81e2bc70245bfe5b3db785bdc928820bc4..cdfa21fa78350b494692f10e7a555a014db59b9b 100644 (file)
@@ -64,7 +64,7 @@ int    scandir(const char *, struct dirent ***,
            int (*)(const struct dirent *), int (*)(const struct dirent **,
            const struct dirent **));
 #endif
-#ifdef _COMPILING_NEWLIB
+#ifdef _LIBC
 void    _seekdir(DIR *, long);
 #endif
 #if __MISC_VISIBLE || __XSI_VISIBLE
index 8abb8db922fb8b507913e730d78c23a4d1bb34ea..ec7f86119c4e99f2c4f2794b0a6404b2350301f9 100644 (file)
@@ -21,7 +21,7 @@
 #define LC_TIME     5
 #define LC_MESSAGES 6
 
-#if __POSIX_VISIBLE >= 200809 || defined (_COMPILING_NEWLIB)
+#if __POSIX_VISIBLE >= 200809 || defined (_LIBC)
 
 #include <sys/_locale.h>
 
index 2b01fbe8f329860fc7d76b681ea063375cb7eb72..23d572cd3c511d0f93502112c0270513521390e0 100644 (file)
@@ -174,7 +174,7 @@ extern int _open64_r (struct _reent *, const char *, int, int);
 extern int _stat64_r (struct _reent *, const char *, struct stat64 *);
 
 /* Don't pollute namespace if not building newlib. */
-#if defined (__CYGWIN__) && !defined (_COMPILING_NEWLIB)
+#if defined (__CYGWIN__) && !defined (_LIBC)
 #undef stat64
 #endif
 
index ab18806e363fa4237835db4e3a11c85ce8d81d42..7748351f09f8369063fdb5cc6550475580e3346e 100644 (file)
@@ -222,13 +222,13 @@ int       puts (const char *);
 int    ungetc (int, FILE *);
 size_t fread (void *__restrict, size_t _size, size_t _n, FILE *__restrict);
 size_t fwrite (const void *__restrict , size_t _size, size_t _n, FILE *);
-#ifdef _COMPILING_NEWLIB
+#ifdef _LIBC
 int    fgetpos (FILE *, _fpos_t *);
 #else
 int    fgetpos (FILE *__restrict, fpos_t *__restrict);
 #endif
 int    fseek (FILE *, long, int);
-#ifdef _COMPILING_NEWLIB
+#ifdef _LIBC
 int    fsetpos (FILE *, const _fpos_t *);
 #else
 int    fsetpos (FILE *, const fpos_t *);
@@ -245,12 +245,12 @@ int       sprintf (char *__restrict, const char *__restrict, ...)
                _ATTRIBUTE ((__format__ (__printf__, 2, 3)));
 int    remove (const char *);
 int    rename (const char *, const char *);
-#ifdef _COMPILING_NEWLIB
+#ifdef _LIBC
 int    _rename (const char *, const char *);
 #endif
 #endif
 #if __LARGEFILE_VISIBLE || __POSIX_VISIBLE >= 200112
-#ifdef _COMPILING_NEWLIB
+#ifdef _LIBC
 int    fseeko (FILE *, _off_t, int);
 _off_t ftello (FILE *);
 #else
@@ -413,7 +413,7 @@ int _fgetc_r (struct _reent *, FILE *);
 int    _fgetc_unlocked_r (struct _reent *, FILE *);
 char *  _fgets_r (struct _reent *, char *__restrict, int, FILE *__restrict);
 char *  _fgets_unlocked_r (struct _reent *, char *__restrict, int, FILE *__restrict);
-#ifdef _COMPILING_NEWLIB
+#ifdef _LIBC
 int    _fgetpos_r (struct _reent *, FILE *__restrict, _fpos_t *__restrict);
 int    _fsetpos_r (struct _reent *, FILE *, const _fpos_t *);
 #else
@@ -549,7 +549,7 @@ int fputs_unlocked (const char *__restrict, FILE *__restrict);
 #endif
 
 #ifdef __LARGE64_FILES
-#if !defined(__CYGWIN__) || defined(_COMPILING_NEWLIB)
+#if !defined(__CYGWIN__) || defined(_LIBC)
 FILE * fdopen64 (int, const char *);
 FILE *  fopen64 (const char *, const char *);
 FILE *  freopen64 (const char *, const char *, FILE *);
index 50a0de44bb29f323ebe8ca2b556cd7ac222c841a..48914c92eab433101718b50c6719a62ba9d34fb5 100644 (file)
@@ -226,7 +226,7 @@ extern int futimesat (int, const char *, const struct timeval [2]);
 
 /* Provide _<systemcall> prototypes for functions provided by some versions
    of newlib.  */
-#ifdef _COMPILING_NEWLIB
+#ifdef _LIBC
 extern int _open (const char *, int, ...);
 extern int _fcntl (int, int, ...);
 #ifdef __LARGE64_FILES
index 6b4999e83482d8996c809ff2827b77c3efec702a..45476ce4ad507575e617e86e2d7f69daee90639f 100644 (file)
@@ -321,7 +321,7 @@ extern "C" {
 
 #if _FORTIFY_SOURCE > 0 && !defined(__cplusplus) && !defined(__lint__) && \
    (__OPTIMIZE__ > 0 || defined(__clang__)) && __GNUC_PREREQ__(4, 1) && \
-   !defined(_COMPILING_NEWLIB)
+   !defined(_LIBC)
 #  if _FORTIFY_SOURCE > 1
 #    define __SSP_FORTIFY_LEVEL 2
 #  else
index 4bd841b80fd2f979144ed3ccaa1e8ae7b029bc3f..8dc5fb9c34fcec26ea49c3d478050fc0690d64b5 100644 (file)
@@ -169,9 +169,9 @@ int sigprocmask (int, const sigset_t *, sigset_t *);
 int pthread_sigmask (int, const sigset_t *, sigset_t *);
 #endif
 
-#ifdef _COMPILING_NEWLIB
+#ifdef _LIBC
 int _kill (pid_t, int);
-#endif /* _COMPILING_NEWLIB */
+#endif /* _LIBC */
 
 #if __POSIX_VISIBLE
 int kill (pid_t, int);
index 3d31ba52f0a8c25e12aaab8645f9e06adf88fdef..6525272dd40123d6ea4e7355a8e6f3a3f3d0dbb8 100644 (file)
@@ -20,7 +20,7 @@ extern "C" {
 
 #ifdef __CYGWIN__
 #include <cygwin/stat.h>
-#ifdef _COMPILING_NEWLIB
+#ifdef _LIBC
 #define stat64 stat
 #endif
 #else
@@ -161,7 +161,7 @@ int futimens (int, const struct timespec [2]);
 
 /* Provide prototypes for most of the _<systemcall> names that are
    provided in newlib for some compilers.  */
-#ifdef _COMPILING_NEWLIB
+#ifdef _LIBC
 int    _fstat (int __fd, struct stat *__sbuf );
 int    _stat (const char *__restrict __path, struct stat *__restrict __sbuf );
 int    _mkdir (const char *_path, mode_t __mode );
index 3be6c1e4163ed1e4b66f196a64da31e79ca80b2f..5a3dec7ab308c9c9e371183d531d4cda5dbb653a 100644 (file)
@@ -436,7 +436,7 @@ int gettimeofday (struct timeval *__restrict __p,
 int futimesat (int, const char *, const struct timeval [2]);
 #endif
 
-#ifdef _COMPILING_NEWLIB
+#ifdef _LIBC
 int _gettimeofday (struct timeval *__p, void *__tz);
 #endif
 
index 05b254714675b5110a8de7bf28fd87b0913e7fab..25dc8bd05aab408022d11819d5049b3eadbe516c 100644 (file)
@@ -22,7 +22,7 @@ struct tms {
 };
 
 clock_t times (struct tms *);
-#ifdef _COMPILING_NEWLIB
+#ifdef _LIBC
 clock_t _times (struct tms *);
 #endif
 
index 6aa5c5298997876b9962490836761a6556b6d390..3cc3130803584ba28409da34d55772dfc5d79e24 100644 (file)
@@ -259,7 +259,7 @@ extern int optreset;                        /* getopt(3) external variable */
 pid_t   vfork (void);
 #endif
 
-#ifdef _COMPILING_NEWLIB
+#ifdef _LIBC
 /* Provide prototypes for most of the _<systemcall> names that are
    provided in newlib for some compilers.  */
 int     _close (int __fildes);
index f17e53f125ac2a22bd31906defb7b3acb9f23196..d15eec9cb6fa1a3fc47a433018cad02b43c12866 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
 pid_t wait (int *);
 pid_t waitpid (pid_t, int *, int);
 
-#ifdef _COMPILING_NEWLIB
+#ifdef _LIBC
 pid_t _wait (int *);
 #endif
 
index 7630a98746e02aa7f5f9bff454969220db9056be..5ba8015b6cd96f6774bc6d38d1f544f0d1712249 100644 (file)
@@ -149,7 +149,7 @@ extern int fcntl (int, int, ...);
 
 /* Provide _<systemcall> prototypes for functions provided by some versions
    of newlib.  */
-#ifdef _COMPILING_NEWLIB
+#ifdef _LIBC
 extern int _open (const char *, int, ...);
 extern int _fcntl (int, int, ...);
 #ifdef __LARGE64_FILES
index cbf06e367a28ff3e8797ce8dca994c45fbe35932..471343fba5ffed405506538e805744192e9c4000 100644 (file)
@@ -33,7 +33,7 @@
 # define USE_MEMMOVE_FOR_OVERLAP
 # define PREFETCH_LOAD_HINT PREFETCH_HINT_LOAD_STREAMED
 # define PREFETCH_STORE_HINT PREFETCH_HINT_PREPAREFORSTORE
-#elif _COMPILING_NEWLIB
+#elif _LIBC
 # include "machine/asm.h"
 # include "machine/regdef.h"
 # define PREFETCH_LOAD_HINT PREFETCH_HINT_LOAD_STREAMED
index 3f1c8be0ead1da218fcffb497afb3d86b498422c..972c57bf260ef0abe2e137d4ec3906e8272198c4 100644 (file)
@@ -31,7 +31,7 @@
 # include "machine/asm.h"
 # include "machine/regdef.h"
 # define PREFETCH_STORE_HINT PREFETCH_HINT_PREPAREFORSTORE
-#elif _COMPILING_NEWLIB
+#elif _LIBC
 # include "machine/asm.h"
 # include "machine/regdef.h"
 # define PREFETCH_STORE_HINT PREFETCH_HINT_PREPAREFORSTORE
index efc41614899d8ff420601ddca61fa96dd8639897..9d33a4ee0d89679a5f13a74e21718c36d7f47dbf 100644 (file)
@@ -30,7 +30,7 @@
 #ifdef ANDROID_CHANGES
 # include "machine/asm.h"
 # include "machine/regdef.h"
-#elif _COMPILING_NEWLIB
+#elif _LIBC
 # include "machine/asm.h"
 # include "machine/regdef.h"
 #else
index 7762557d6cf2ed64d34a7c2cc6c250bbaf469dff..a181ce58c7ec6507f36978e3f796fc4f75d754b4 100644 (file)
@@ -10,7 +10,7 @@ details. */
 #include <stdlib.h>
 #include <unistd.h>
 
-#define _COMPILING_NEWLIB
+#define _LIBC
 #include <dirent.h>
 
 #include "cygerrno.h"
index 508cc3650538bb106eb419227ee9bb9e2a983dc5..91331aaad97971bd81baec7d09533beb11b62737 100644 (file)
@@ -17,7 +17,7 @@ details. */
 #include "cygheap.h"
 #include "shared_info.h"
 
-#define _COMPILING_NEWLIB
+#define _LIBC
 #include <dirent.h>
 
 fhandler_cygdrive::fhandler_cygdrive () :
index 5fd75a58e3765526cd88243bc0cee091676c2117..934cdf3581da090915488569429aae9724ad374f 100644 (file)
@@ -15,7 +15,7 @@ details. */
 #include "cygheap.h"
 #include "devices.h"
 
-#define _COMPILING_NEWLIB
+#define _LIBC
 #include <dirent.h>
 
 #define dev_prefix_len (sizeof ("/dev"))
index 33d88581951fe7bf17a492775d20a6d54d779c1d..26726c5d7a0d886cd06c34ae38dfda60d46a8b32 100644 (file)
@@ -27,7 +27,7 @@ details. */
 #include <aio.h>
 #include <cygwin/fs.h>
 
-#define _COMPILING_NEWLIB
+#define _LIBC
 #include <dirent.h>
 
 enum __DIR_mount_type {
index c8074dd22343de22b1f673027c22d4b677ded740..6ec6f8bc47d94b968af3923f403baebecad1f624 100644 (file)
@@ -32,7 +32,7 @@ details. */
 #include "mount.h"
 #include <math.h>
 
-#define _COMPILING_NEWLIB
+#define _LIBC
 #include <dirent.h>
 
 static off_t format_proc_loadavg (void *, char *&);
index 888604e3d2bc56b60b345621c8a87b5592f257e9..270b27f58eb777bdb67f31171e8d94d5c38e2361 100644 (file)
@@ -27,7 +27,7 @@ details. */
 #include <sys/param.h>
 #include <ctype.h>
 
-#define _COMPILING_NEWLIB
+#define _LIBC
 #include <dirent.h>
 
 static off_t format_process_maps (void *, char *&);
index 516864388a89e1afdc71595266f0eb0997c01aec..c2c7e0f9912c19fc05fca3edb604d3d673a08ef2 100644 (file)
@@ -26,7 +26,7 @@ details. */
 #include <sys/param.h>
 #include <ctype.h>
 
-#define _COMPILING_NEWLIB
+#define _LIBC
 #include <dirent.h>
 
 #define _KERNEL
index 5696a4904d43fc7a9c5f41022b347dd1d98cf4e9..747b76de30ad5c600b1f11a6f4c2de71a2af9f38 100644 (file)
@@ -18,7 +18,7 @@ details. */
 #include "cygheap.h"
 #include "child_info.h"
 
-#define _COMPILING_NEWLIB
+#define _LIBC
 #include <dirent.h>
 
 /* If this bit is set in __d_position then we are enumerating values,
index 282637b67130d20c31c577e8f8fcc8be0fb8f00a..71a216fbd16d0452880cdd215e43745667fb434a 100644 (file)
@@ -35,7 +35,7 @@ extern "C" {
    compute these offsets already exists for the sake of gendef so
    we might as well just use it here.  */
 
-#if defined (_COMPILING_NEWLIB) || defined (__INSIDE_CYGWIN__)
+#if defined (_LIBC) || defined (__INSIDE_CYGWIN__)
 #ifdef __x86_64__
 #include "../tlsoffsets64.h"
 #else
@@ -52,7 +52,7 @@ extern inline struct _reent *__getreent (void)
 #endif
   return (struct _reent *) (ret + tls_local_clib);
 }
-#endif /* _COMPILING_NEWLIB || __INSIDE_CYGWIN__ */
+#endif /* _LIBC || __INSIDE_CYGWIN__ */
 
 #ifdef __x86_64__
 # define __SYMBOL_PREFIX
@@ -81,7 +81,7 @@ extern inline struct _reent *__getreent (void)
 #define __TM_ZONE   tm_zone
 #define _USE_LONG_TIME_T 1
 
-#if defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB)
+#if defined(__INSIDE_CYGWIN__) || defined(_LIBC)
 #define __EXPORT __declspec(dllexport)
 #define __IMPORT
 #else
index 0e489d7a981ec554e4c5b1b0adc5c30e2b3840d9..1530529105d8bfda7f29b0ce40b6a3015638ea9f 100644 (file)
@@ -32,7 +32,7 @@ struct stat
   timestruc_t   st_birthtim;
 };
 
-#if defined (__INSIDE_CYGWIN__) || defined (_COMPILING_NEWLIB)
+#if defined (__INSIDE_CYGWIN__) || defined (_LIBC)
 #ifdef __i386__
 struct __stat32
 {
index e274b8b9465f37b6e21f017f6b3e69fb88ecd427..dd1077b51d2bed30f41ce5281610f4cb4aaebd21 100644 (file)
@@ -43,7 +43,7 @@ int getpt (void);
 int posix_openpt (int);
 #endif
 
-#ifdef _COMPILING_NEWLIB
+#ifdef _LIBC
 #define unsetenv UNUSED_unsetenv
 #define _unsetenv_r UNUSED__unsetenv_r
 #endif
index 19c347b91594a85929fafcd3eb968473cca5b495..c5af1acd469f13b5236c62c177ea142adc1b59ce 100644 (file)
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 
-#ifdef _COMPILING_NEWLIB
+#ifdef _LIBC
 #include_next "getopt.h"
 #else
 #ifndef __GETOPT_H__
index 7e636f8f833a551bcab5d64275c553dae5fbe8d4..d84890f401ba98c32624791f91f88915bcf113c6 100644 (file)
@@ -5,7 +5,7 @@
 
 #include <machine/_default_types.h>
 
-#if defined (__INSIDE_CYGWIN__) || defined (_COMPILING_NEWLIB)
+#if defined (__INSIDE_CYGWIN__) || defined (_LIBC)
 typedef __int32_t __blkcnt32_t;
 typedef __int16_t  __dev16_t;
 typedef __uint16_t __uid16_t;
index 177a553b2a734d4cdd9b5a20d73e20ef7064c6b1..0e7a78cc08bd44e9bcb4ab55ab00f75e15a483b1 100644 (file)
@@ -45,7 +45,7 @@ struct dirent
 #endif
 typedef struct __DIR
 {
-  /* This is first to set alignment in non _COMPILING_NEWLIB case.  */
+  /* This is first to set alignment in non _LIBC case.  */
   unsigned long __d_cookie;
   struct dirent *__d_dirent;
   char *__d_dirname;                   /* directory name with trailing '*' */
index ff14e76cdf7fde4141b01fc9de8d84735a3d00b1..5ebdc193804f195e1e4631e39d96f16723994953 100644 (file)
@@ -9,7 +9,7 @@ details. */
 #ifndef _SYS_SYSLIMITS_H
 #define _SYS_SYSLIMITS_H
 
-#ifdef _COMPILING_NEWLIB
+#ifdef _LIBC
 # include <limits.h>
 #else
 # error "Do not include sys/syslimits.h from applications directly."
index 1ed1f5a2e801990ce5150f8dfef5c75140a4b67f..26ec28b6d7cf1329612f255f606680644ff1b66b 100644 (file)
@@ -22,7 +22,7 @@ pid_t waitpid (pid_t __pid, int *__status, int __options);
 pid_t wait3 (int *__status, int __options, struct rusage *__rusage);
 pid_t wait4 (pid_t __pid, int *__status, int __options, struct rusage *__rusage);
 
-#ifdef _COMPILING_NEWLIB
+#ifdef _LIBC
 pid_t _wait (int *);
 #endif
 
index e54e61d71fbccfb1d873ad90af41ffee81c1e458..de1058783c9b02e049c83e2ed79c2ace91665332 100644 (file)
@@ -44,7 +44,7 @@
 
 #ifdef __CYGWIN__
 /* Disable __IMPORT when defining __fdlib_version. */
-#define _COMPILING_NEWLIB
+#define _LIBC
 #define _GNU_SOURCE
 #endif
 #include <math.h>
This page took 0.0729610000000001 seconds and 5 git commands to generate.