Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2002-10-11 14:28:30 +0400
committerRichard Sandiford <rdsandiford@googlemail.com>2002-10-11 14:28:30 +0400
commitf770cf44c3fc734d56e249d3a8324c8c21fe3cb4 (patch)
tree83eb7e8045015ec53f072fd60d2c3f32f28c231e
parentafc65aebbdde338f969adc7302fe9581bca8f1c0 (diff)
* libc/include/sys/config.h (SIZE_T_SMALLER_THAN_LONG): Undefine.
* libc/stdlib/mallocr.c (long_sub_size_t): Define in a way that doesn't require the SIZE_T_SMALLER_THAN_LONG macro.
-rw-r--r--newlib/ChangeLog6
-rw-r--r--newlib/libc/include/sys/config.h1
-rw-r--r--newlib/libc/stdlib/mallocr.c13
3 files changed, 10 insertions, 10 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 3f253780f..a7b102e80 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,9 @@
+2002-10-11 Richard Sandiford <rsandifo@redhat.com>
+
+ * libc/include/sys/config.h (SIZE_T_SMALLER_THAN_LONG): Undefine.
+ * libc/stdlib/mallocr.c (long_sub_size_t): Define in a way that
+ doesn't require the SIZE_T_SMALLER_THAN_LONG macro.
+
2002-10-07 Joel Sherrill <joel@OARcorp.com>
* libc/sys/rtems/crt0.c: Add even more symbols so gcc() can link
diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h
index 2f54b0aac..5d8911a8b 100644
--- a/newlib/libc/include/sys/config.h
+++ b/newlib/libc/include/sys/config.h
@@ -91,7 +91,6 @@
#undef UINT_MAX
#define INT_MAX __INT_MAX__
#define UINT_MAX (__INT_MAX__ * 2U + 1)
-#define SIZE_T_SMALLER_THAN_LONG
#define MALLOC_ALIGNMENT 8
#define _POINTER_INT short
#define __BUFSIZ__ 16
diff --git a/newlib/libc/stdlib/mallocr.c b/newlib/libc/stdlib/mallocr.c
index b4fa555a4..3da707e3d 100644
--- a/newlib/libc/stdlib/mallocr.c
+++ b/newlib/libc/stdlib/mallocr.c
@@ -168,10 +168,6 @@ int _dummy_mallocr = 1;
MALLOC_ALIGNMENT (default: NOT defined)
Define this to 16 if you need 16 byte alignment instead of 8 byte alignment
which is the normal default.
- SIZE_T_SMALLER_THAN_LONG (default: NOT defined)
- Define this when the platform you are compiling has sizeof(long) > sizeof(size_t).
- The option causes some extra code to be generated to handle operations
- that use size_t operands and have long results.
REALLOC_ZERO_BYTES_FREES (default: NOT defined)
Define this if you think that realloc(p, 0) should be equivalent
to free(p). Otherwise, since malloc returns a unique pointer for
@@ -448,11 +444,10 @@ extern void __malloc_unlock();
fact that assignment from unsigned to signed won't sign extend.
*/
-#ifdef SIZE_T_SMALLER_THAN_LONG
-#define long_sub_size_t(x, y) ( (x < y) ? -((long)(y - x)) : (x - y) );
-#else
-#define long_sub_size_t(x, y) ( (long)(x - y) )
-#endif
+#define long_sub_size_t(x, y) \
+ (sizeof (long) > sizeof (INTERNAL_SIZE_T) && x < y \
+ ? -(long) (y - x) \
+ : (long) (x - y))
/*
REALLOC_ZERO_BYTES_FREES should be set if a call to