Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/include make CHAR_{MIN, MAX} work for both -fsigned-char and ...



details:   https://anonhg.NetBSD.org/src/rev/d9671b192b0b
branches:  trunk
changeset: 778473:d9671b192b0b
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Mar 28 17:04:41 2012 +0000

description:
make CHAR_{MIN,MAX} work for both -fsigned-char and -funsigned-char

diffstat:

 include/limits.h |  11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diffs (25 lines):

diff -r ccc1b7ed0808 -r d9671b192b0b include/limits.h
--- a/include/limits.h  Wed Mar 28 17:03:27 2012 +0000
+++ b/include/limits.h  Wed Mar 28 17:04:41 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: limits.h,v 1.31 2011/10/06 16:02:52 christos Exp $     */
+/*     $NetBSD: limits.h,v 1.32 2012/03/28 17:04:41 christos Exp $     */
 
 /*
  * Copyright (c) 1988, 1993
@@ -162,6 +162,15 @@
 #endif
 
 #include <machine/limits.h>
+
+#ifdef __CHAR_UNSIGNED__
+# define CHAR_MIN     0
+# define CHAR_MAX     UCHAR_MAX
+#else
+# define CHAR_MIN     SCHAR_MIN
+# define CHAR_MAX     SCHAR_MAX
+#endif
+
 #include <sys/syslimits.h>
 
 #endif /* !_LIMITS_H_ */



Home | Main Index | Thread Index | Old Index