Module Name:    src
Committed By:   joerg
Date:           Fri Apr 26 21:20:48 UTC 2013

Modified Files:
        src/common/lib/libc/stdlib: _strtol.h _strtoul.h
        src/lib/libc/citrus: citrus_bcs_strtol.c citrus_bcs_strtoul.c

Log Message:
Restore standalone strtol/strtoul for citrus for now.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/common/lib/libc/stdlib/_strtol.h \
    src/common/lib/libc/stdlib/_strtoul.h
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/citrus_bcs_strtol.c
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/citrus/citrus_bcs_strtoul.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/stdlib/_strtol.h
diff -u src/common/lib/libc/stdlib/_strtol.h:1.5 src/common/lib/libc/stdlib/_strtol.h:1.6
--- src/common/lib/libc/stdlib/_strtol.h:1.5	Tue Apr 16 21:44:06 2013
+++ src/common/lib/libc/stdlib/_strtol.h	Fri Apr 26 21:20:48 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: _strtol.h,v 1.5 2013/04/16 21:44:06 joerg Exp $ */
+/* $NetBSD: _strtol.h,v 1.6 2013/04/26 21:20:48 joerg Exp $ */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -41,7 +41,7 @@
  *      __INT_MIN : lower limit of the return type
  *      __INT_MAX : upper limit of the return type
  */
-#if defined(_KERNEL) || defined(_STANDALONE) || defined(HAVE_NBTOOL_CONFIG_H)
+#if defined(_KERNEL) || defined(_STANDALONE) || defined(HAVE_NBTOOL_CONFIG_H) || defined(BCS_ONLY)
 __INT
 _FUNCNAME(const char *nptr, char **endptr, int base)
 #else
@@ -82,7 +82,8 @@ INT_FUNCNAME(_int_, _FUNCNAME, _l)(const
 	 * assume decimal; if base is already 16, allow 0x.
 	 */
 	s = nptr;
-#if defined(_KERNEL) || defined(_STANDALONE) || defined(HAVE_NBTOOL_CONFIG_H)
+#if defined(_KERNEL) || defined(_STANDALONE) || \
+    defined(HAVE_NBTOOL_CONFIG_H) || defined(BCS_ONLY)
 	do {
 		c = *s++;
 	} while (isspace(c));
@@ -186,7 +187,8 @@ INT_FUNCNAME(_int_, _FUNCNAME, _l)(const
 	return(acc);
 }
 
-#if !defined(_KERNEL) && !defined(_STANDALONE) && !defined(HAVE_NBTOOL_CONFIG_H)
+#if !defined(_KERNEL) && !defined(_STANDALONE) && \
+    !defined(HAVE_NBTOOL_CONFIG_H) && !defined(BCS_ONLY)
 __INT
 _FUNCNAME(const char *nptr, char **endptr, int base)
 {
Index: src/common/lib/libc/stdlib/_strtoul.h
diff -u src/common/lib/libc/stdlib/_strtoul.h:1.5 src/common/lib/libc/stdlib/_strtoul.h:1.6
--- src/common/lib/libc/stdlib/_strtoul.h:1.5	Tue Apr 16 21:44:06 2013
+++ src/common/lib/libc/stdlib/_strtoul.h	Fri Apr 26 21:20:48 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: _strtoul.h,v 1.5 2013/04/16 21:44:06 joerg Exp $ */
+/* $NetBSD: _strtoul.h,v 1.6 2013/04/26 21:20:48 joerg Exp $ */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -40,7 +40,8 @@
  *      __UINT     : return type
  *      __UINT_MAX : upper limit of the return type
  */
-#if defined(_KERNEL) || defined(_STANDALONE) || defined(HAVE_NBTOOL_CONFIG_H)
+#if defined(_KERNEL) || defined(_STANDALONE) || \
+    defined(HAVE_NBTOOL_CONFIG_H) || defined(BCS_ONLY)
 __UINT
 _FUNCNAME(const char *nptr, char **endptr, int base)
 #else
@@ -78,7 +79,8 @@ INT_FUNCNAME(_int_, _FUNCNAME, _l)(const
 	 * assume decimal; if base is already 16, allow 0x.
 	 */
 	s = nptr;
-#if defined(_KERNEL) || defined(_STANDALONE) || defined(HAVE_NBTOOL_CONFIG_H)
+#if defined(_KERNEL) || defined(_STANDALONE) || \
+    defined(HAVE_NBTOOL_CONFIG_H) || defined(BCS_ONLY)
 	do {
 		c = *s++;
 	} while (isspace(c));
@@ -145,7 +147,8 @@ INT_FUNCNAME(_int_, _FUNCNAME, _l)(const
 	return(acc);
 }
 
-#if !defined(_KERNEL) && !defined(_STANDALONE) && !defined(HAVE_NBTOOL_CONFIG_H)
+#if !defined(_KERNEL) && !defined(_STANDALONE) && \
+    !defined(HAVE_NBTOOL_CONFIG_H) && !defined(BCS_ONLY)
 __UINT
 _FUNCNAME(const char *nptr, char **endptr, int base)
 {

Index: src/lib/libc/citrus/citrus_bcs_strtol.c
diff -u src/lib/libc/citrus/citrus_bcs_strtol.c:1.3 src/lib/libc/citrus/citrus_bcs_strtol.c:1.4
--- src/lib/libc/citrus/citrus_bcs_strtol.c:1.3	Tue Apr 16 21:44:07 2013
+++ src/lib/libc/citrus/citrus_bcs_strtol.c	Fri Apr 26 21:20:47 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_bcs_strtol.c,v 1.3 2013/04/16 21:44:07 joerg Exp $ */
+/* $NetBSD: citrus_bcs_strtol.c,v 1.4 2013/04/26 21:20:47 joerg Exp $ */
 
 /*-
  * Copyright (c) 2005 The DragonFly Project.  All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: citrus_bcs_strtol.c,v 1.3 2013/04/16 21:44:07 joerg Exp $");
+__RCSID("$NetBSD: citrus_bcs_strtol.c,v 1.4 2013/04/26 21:20:47 joerg Exp $");
 
 #include <assert.h>
 #include <errno.h>
@@ -39,12 +39,23 @@ __RCSID("$NetBSD: citrus_bcs_strtol.c,v 
 #include "citrus_namespace.h"
 #include "citrus_bcs.h"
 
-long int
-_bcs_strtol(const char * __restrict nptr, char ** __restrict endptr, int base)
-{
-#if defined(HAVE_NBTOOL_CONFIG_H)
-	return strtol(nptr, endptr, base);
-#else
-	return strtol_l(nptr, endptr, base, 0);
-#endif
-}
+#define	BCS_ONLY
+
+#define	_FUNCNAME	_bcs_strtol
+#define	__INT		long int
+#define	__INT_MIN	LONG_MIN
+#define	__INT_MAX	LONG_MAX
+
+#undef isspace
+#define isspace(c)	_bcs_isspace(c)
+
+#undef isdigit
+#define isdigit(c)	_bcs_isdigit(c)
+
+#undef isalpha
+#define isalpha(c)	_bcs_isalpha(c)
+
+#undef isupper
+#define isupper(c)	_bcs_isupper(c)
+
+#include "_strtol.h"

Index: src/lib/libc/citrus/citrus_bcs_strtoul.c
diff -u src/lib/libc/citrus/citrus_bcs_strtoul.c:1.4 src/lib/libc/citrus/citrus_bcs_strtoul.c:1.5
--- src/lib/libc/citrus/citrus_bcs_strtoul.c:1.4	Tue Apr 16 21:44:07 2013
+++ src/lib/libc/citrus/citrus_bcs_strtoul.c	Fri Apr 26 21:20:48 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_bcs_strtoul.c,v 1.4 2013/04/16 21:44:07 joerg Exp $ */
+/* $NetBSD: citrus_bcs_strtoul.c,v 1.5 2013/04/26 21:20:48 joerg Exp $ */
 
 /*-
  * Copyright (c) 2005 The DragonFly Project.  All rights reserved.
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: citrus_bcs_strtoul.c,v 1.4 2013/04/16 21:44:07 joerg Exp $");
+__RCSID("$NetBSD: citrus_bcs_strtoul.c,v 1.5 2013/04/26 21:20:48 joerg Exp $");
 #endif /* not lint */
 
 #include <assert.h>
@@ -45,12 +45,22 @@ __RCSID("$NetBSD: citrus_bcs_strtoul.c,v
 #include "citrus_namespace.h"
 #include "citrus_bcs.h"
 
-unsigned long int
-_bcs_strtoul(const char * __restrict nptr, char ** __restrict endptr, int base)
-{
-#if defined(HAVE_NBTOOL_CONFIG_H)
-	return strtoul(nptr, endptr, base);
-#else
-	return strtoul_l(nptr, endptr, base, 0);
-#endif
-}
+#define	BCS_ONLY
+
+#define	_FUNCNAME	_bcs_strtoul
+#define	__UINT		unsigned long int
+#define	__UINT_MAX	ULONG_MAX
+
+#undef isspace
+#define isspace(c)	_bcs_isspace(c)
+
+#undef isdigit
+#define isdigit(c)	_bcs_isdigit(c)
+
+#undef isalpha
+#define isalpha(c)	_bcs_isalpha(c)
+
+#undef isupper
+#define isupper(c)	_bcs_isupper(c)
+
+#include "_strtoul.h"

Reply via email to