Index: lib/libc/citrus/citrus_bcs_strtoul.c =================================================================== RCS file: /cvsroot/src/lib/libc/citrus/citrus_bcs_strtoul.c,v retrieving revision 1.1 diff -u -r1.1 citrus_bcs_strtoul.c --- lib/libc/citrus/citrus_bcs_strtoul.c 2 Jan 2009 00:20:19 -0000 1.1 +++ lib/libc/citrus/citrus_bcs_strtoul.c 4 Jan 2009 14:15:16 -0000 @@ -27,15 +27,15 @@ * SUCH DAMAGE. */ +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include #if !defined(lint) __RCSID("$NetBSD: citrus_bcs_strtoul.c,v 1.1 2009/01/02 00:20:19 tnozaki Exp $"); #endif /* not lint */ -#if HAVE_NBTOOL_CONFIG_H -#include "nbtool_config.h" -#endif - #include #include #include Index: lib/libc/locale/fix_grouping.c =================================================================== RCS file: /cvsroot/src/lib/libc/locale/fix_grouping.c,v retrieving revision 1.1 diff -u -r1.1 fix_grouping.c --- lib/libc/locale/fix_grouping.c 2 Jan 2009 00:20:20 -0000 1.1 +++ lib/libc/locale/fix_grouping.c 4 Jan 2009 14:15:19 -0000 @@ -29,6 +29,10 @@ * FreeBSD: fix_grouping.c,v 1.8 2003/06/26 10:46:16 phantom Exp */ +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include #if defined(LIBC_SCCS) && !defined(lint) __RCSID("$NetBSD: fix_grouping.c,v 1.1 2009/01/02 00:20:20 tnozaki Exp $"); Index: lib/libc/locale/iswctype_sb.c =================================================================== RCS file: /cvsroot/src/lib/libc/locale/iswctype_sb.c,v retrieving revision 1.6 diff -u -r1.6 iswctype_sb.c --- lib/libc/locale/iswctype_sb.c 2 Jan 2009 00:20:20 -0000 1.6 +++ lib/libc/locale/iswctype_sb.c 4 Jan 2009 14:15:19 -0000 @@ -67,6 +67,7 @@ wint_t \ tow##name(wint_t wc) \ { \ + int c; \ c = (wc == WEOF) ? EOF : (unsigned char)wc; \ return to##name(c); \ } Index: lib/libc/locale/rune.h =================================================================== RCS file: /cvsroot/src/lib/libc/locale/rune.h,v retrieving revision 1.13 diff -u -r1.13 rune.h --- lib/libc/locale/rune.h 2 Jan 2009 00:20:20 -0000 1.13 +++ lib/libc/locale/rune.h 4 Jan 2009 14:15:19 -0000 @@ -39,7 +39,7 @@ #include #include -#include "runetype.h" +#include "runetype_local.h" /* * map _RTYPE_x to _CTYPE_x Index: lib/libc/locale/runetype.h =================================================================== RCS file: lib/libc/locale/runetype.h diff -N lib/libc/locale/runetype.h --- lib/libc/locale/runetype.h 29 Sep 2007 08:10:17 -0000 1.21 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,226 +0,0 @@ -/* $NetBSD: runetype.h,v 1.21 2007/09/29 08:10:17 tnozaki Exp $ */ - -/*- - * Copyright (c) 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Paul Borman at Krystal Technologies. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)runetype.h 8.1 (Berkeley) 6/2/93 - */ - -#ifndef _NB_RUNETYPE_H_ -#define _NB_RUNETYPE_H_ - -#include -#include - -/* for cross host tools on older systems */ -#ifndef UINT32_C -/* assumes sizeof(unsigned int)>=4 */ -#define UINT32_C(c) ((uint32_t)(c##U)) -#endif - -typedef uint32_t __nbrune_t; -typedef uint64_t __runepad_t; - -#define _NB_CACHED_RUNES (1 << 8) /* Must be a power of 2 */ -#define _NB_RUNE_ISCACHED(c) ((c)>=0 && (c)<_CACHED_RUNES) - -#define _NB_DEFAULT_INVALID_RUNE ((__nbrune_t)-3) - -/* - * The lower 8 bits of runetype[] contain the digit value of the rune. - */ -typedef uint32_t _RuneType; -#define _RUNETYPE_A UINT32_C(0x00000100) /* Alpha */ -#define _RUNETYPE_C UINT32_C(0x00000200) /* Control */ -#define _RUNETYPE_D UINT32_C(0x00000400) /* Digit */ -#define _RUNETYPE_G UINT32_C(0x00000800) /* Graph */ -#define _RUNETYPE_L UINT32_C(0x00001000) /* Lower */ -#define _RUNETYPE_P UINT32_C(0x00002000) /* Punct */ -#define _RUNETYPE_S UINT32_C(0x00004000) /* Space */ -#define _RUNETYPE_U UINT32_C(0x00008000) /* Upper */ -#define _RUNETYPE_X UINT32_C(0x00010000) /* X digit */ -#define _RUNETYPE_B UINT32_C(0x00020000) /* Blank */ -#define _RUNETYPE_R UINT32_C(0x00040000) /* Print */ -#define _RUNETYPE_I UINT32_C(0x00080000) /* Ideogram */ -#define _RUNETYPE_T UINT32_C(0x00100000) /* Special */ -#define _RUNETYPE_Q UINT32_C(0x00200000) /* Phonogram */ -#define _RUNETYPE_SWM UINT32_C(0xc0000000)/* Mask to get screen width data */ -#define _RUNETYPE_SWS 30 /* Bits to shift to get width */ -#define _RUNETYPE_SW0 UINT32_C(0x00000000) /* 0 width character */ -#define _RUNETYPE_SW1 UINT32_C(0x40000000) /* 1 width character */ -#define _RUNETYPE_SW2 UINT32_C(0x80000000) /* 2 width character */ -#define _RUNETYPE_SW3 UINT32_C(0xc0000000) /* 3 width character */ - - -/* - * rune file format. network endian. - */ -typedef struct { - int32_t fre_min; /* First rune of the range */ - int32_t fre_max; /* Last rune (inclusive) of the range */ - int32_t fre_map; /* What first maps to in maps */ - uint32_t fre_pad1; /* backward compatibility */ - __runepad_t fre_pad2; /* backward compatibility */ -} __packed _FileRuneEntry; - - -typedef struct { - uint32_t frr_nranges; /* Number of ranges stored */ - uint32_t frr_pad1; /* backward compatibility */ - __runepad_t frr_pad2; /* backward compatibility */ -} __packed _FileRuneRange; - - -typedef struct { - char frl_magic[8]; /* Magic saying what version we are */ - char frl_encoding[32];/* ASCII name of this encoding */ - - __runepad_t frl_pad1; /* backward compatibility */ - __runepad_t frl_pad2; /* backward compatibility */ - int32_t frl_invalid_rune; - uint32_t frl_pad3; /* backward compatibility */ - - _RuneType frl_runetype[_NB_CACHED_RUNES]; - int32_t frl_maplower[_NB_CACHED_RUNES]; - int32_t frl_mapupper[_NB_CACHED_RUNES]; - - /* - * The following are to deal with Runes larger than _CACHED_RUNES - 1. - * Their data is actually contiguous with this structure so as to make - * it easier to read/write from/to disk. - */ - _FileRuneRange frl_runetype_ext; - _FileRuneRange frl_maplower_ext; - _FileRuneRange frl_mapupper_ext; - - __runepad_t frl_pad4; /* backward compatibility */ - int32_t frl_variable_len;/* how long that data is */ - uint32_t frl_pad5; /* backward compatibility */ - - /* variable size data follows */ -} __packed _FileRuneLocale; - - -/* - * expanded rune locale declaration. local to the host. host endian. - */ -typedef struct { - __nbrune_t re_min; /* First rune of the range */ - __nbrune_t re_max; /* Last rune (inclusive) of the range */ - __nbrune_t re_map; /* What first maps to in maps */ - _RuneType *re_rune_types; /* Array of types in range */ -} _NBRuneEntry; - - -typedef struct { - uint32_t rr_nranges; /* Number of ranges stored */ - _NBRuneEntry *rr_rune_ranges; -} _NBRuneRange; - - -/* - * wctrans stuffs. - */ -typedef struct _WCTransEntry { - const char *te_name; - __nbrune_t *te_cached; - _NBRuneRange *te_extmap; -} _WCTransEntry; -#define _WCTRANS_INDEX_LOWER 0 -#define _WCTRANS_INDEX_UPPER 1 -#define _WCTRANS_NINDEXES 2 - -/* - * wctype stuffs. - */ -typedef struct _WCTypeEntry { - const char *te_name; - _RuneType te_mask; -} _WCTypeEntry; -#define _WCTYPE_INDEX_ALNUM 0 -#define _WCTYPE_INDEX_ALPHA 1 -#define _WCTYPE_INDEX_BLANK 2 -#define _WCTYPE_INDEX_CNTRL 3 -#define _WCTYPE_INDEX_DIGIT 4 -#define _WCTYPE_INDEX_GRAPH 5 -#define _WCTYPE_INDEX_LOWER 6 -#define _WCTYPE_INDEX_PRINT 7 -#define _WCTYPE_INDEX_PUNCT 8 -#define _WCTYPE_INDEX_SPACE 9 -#define _WCTYPE_INDEX_UPPER 10 -#define _WCTYPE_INDEX_XDIGIT 11 -#define _WCTYPE_NINDEXES 12 - -/* - * ctype stuffs - */ - -typedef struct _NBRuneLocale { - /* - * copied from _FileRuneLocale - */ - char rl_magic[8]; /* Magic saying what version we are */ - char rl_encoding[32];/* ASCII name of this encoding */ - __nbrune_t rl_invalid_rune; - _RuneType rl_runetype[_NB_CACHED_RUNES]; - __nbrune_t rl_maplower[_NB_CACHED_RUNES]; - __nbrune_t rl_mapupper[_NB_CACHED_RUNES]; - _NBRuneRange rl_runetype_ext; - _NBRuneRange rl_maplower_ext; - _NBRuneRange rl_mapupper_ext; - - void *rl_variable; - size_t rl_variable_len; - - /* - * the following portion is generated on the fly - */ - const char *rl_codeset; - struct _citrus_ctype_rec *rl_citrus_ctype; - _WCTransEntry rl_wctrans[_WCTRANS_NINDEXES]; - _WCTypeEntry rl_wctype[_WCTYPE_NINDEXES]; - - const unsigned char *rl_ctype_tab; - const short *rl_tolower_tab; - const short *rl_toupper_tab; -} _NBRuneLocale; - - -/* magic number for LC_CTYPE (rune)locale declaration */ -#define _NB_RUNE_MAGIC_1 "RuneCT10" /* Indicates version 0 of RuneLocale */ - -/* magic string for dynamic link module - type should be like "LC_CTYPE" */ -#define _NB_RUNE_MODULE_1(type) "RuneModule10." type - -/* codeset tag */ -#define _NB_RUNE_CODESET "CODESET=" - -#endif /* !_NB_RUNETYPE_H_ */ Index: lib/libc/locale/runetype_local.h =================================================================== RCS file: lib/libc/locale/runetype_local.h diff -N lib/libc/locale/runetype_local.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lib/libc/locale/runetype_local.h 4 Jan 2009 14:15:21 -0000 @@ -0,0 +1,226 @@ +/* $NetBSD: runetype.h,v 1.21 2007/09/29 08:10:17 tnozaki Exp $ */ + +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)runetype.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _NB_RUNETYPE_H_ +#define _NB_RUNETYPE_H_ + +#include +#include + +/* for cross host tools on older systems */ +#ifndef UINT32_C +/* assumes sizeof(unsigned int)>=4 */ +#define UINT32_C(c) ((uint32_t)(c##U)) +#endif + +typedef uint32_t __nbrune_t; +typedef uint64_t __runepad_t; + +#define _NB_CACHED_RUNES (1 << 8) /* Must be a power of 2 */ +#define _NB_RUNE_ISCACHED(c) ((c)>=0 && (c)<_CACHED_RUNES) + +#define _NB_DEFAULT_INVALID_RUNE ((__nbrune_t)-3) + +/* + * The lower 8 bits of runetype[] contain the digit value of the rune. + */ +typedef uint32_t _RuneType; +#define _RUNETYPE_A UINT32_C(0x00000100) /* Alpha */ +#define _RUNETYPE_C UINT32_C(0x00000200) /* Control */ +#define _RUNETYPE_D UINT32_C(0x00000400) /* Digit */ +#define _RUNETYPE_G UINT32_C(0x00000800) /* Graph */ +#define _RUNETYPE_L UINT32_C(0x00001000) /* Lower */ +#define _RUNETYPE_P UINT32_C(0x00002000) /* Punct */ +#define _RUNETYPE_S UINT32_C(0x00004000) /* Space */ +#define _RUNETYPE_U UINT32_C(0x00008000) /* Upper */ +#define _RUNETYPE_X UINT32_C(0x00010000) /* X digit */ +#define _RUNETYPE_B UINT32_C(0x00020000) /* Blank */ +#define _RUNETYPE_R UINT32_C(0x00040000) /* Print */ +#define _RUNETYPE_I UINT32_C(0x00080000) /* Ideogram */ +#define _RUNETYPE_T UINT32_C(0x00100000) /* Special */ +#define _RUNETYPE_Q UINT32_C(0x00200000) /* Phonogram */ +#define _RUNETYPE_SWM UINT32_C(0xc0000000)/* Mask to get screen width data */ +#define _RUNETYPE_SWS 30 /* Bits to shift to get width */ +#define _RUNETYPE_SW0 UINT32_C(0x00000000) /* 0 width character */ +#define _RUNETYPE_SW1 UINT32_C(0x40000000) /* 1 width character */ +#define _RUNETYPE_SW2 UINT32_C(0x80000000) /* 2 width character */ +#define _RUNETYPE_SW3 UINT32_C(0xc0000000) /* 3 width character */ + + +/* + * rune file format. network endian. + */ +typedef struct { + int32_t fre_min; /* First rune of the range */ + int32_t fre_max; /* Last rune (inclusive) of the range */ + int32_t fre_map; /* What first maps to in maps */ + uint32_t fre_pad1; /* backward compatibility */ + __runepad_t fre_pad2; /* backward compatibility */ +} __packed _FileRuneEntry; + + +typedef struct { + uint32_t frr_nranges; /* Number of ranges stored */ + uint32_t frr_pad1; /* backward compatibility */ + __runepad_t frr_pad2; /* backward compatibility */ +} __packed _FileRuneRange; + + +typedef struct { + char frl_magic[8]; /* Magic saying what version we are */ + char frl_encoding[32];/* ASCII name of this encoding */ + + __runepad_t frl_pad1; /* backward compatibility */ + __runepad_t frl_pad2; /* backward compatibility */ + int32_t frl_invalid_rune; + uint32_t frl_pad3; /* backward compatibility */ + + _RuneType frl_runetype[_NB_CACHED_RUNES]; + int32_t frl_maplower[_NB_CACHED_RUNES]; + int32_t frl_mapupper[_NB_CACHED_RUNES]; + + /* + * The following are to deal with Runes larger than _CACHED_RUNES - 1. + * Their data is actually contiguous with this structure so as to make + * it easier to read/write from/to disk. + */ + _FileRuneRange frl_runetype_ext; + _FileRuneRange frl_maplower_ext; + _FileRuneRange frl_mapupper_ext; + + __runepad_t frl_pad4; /* backward compatibility */ + int32_t frl_variable_len;/* how long that data is */ + uint32_t frl_pad5; /* backward compatibility */ + + /* variable size data follows */ +} __packed _FileRuneLocale; + + +/* + * expanded rune locale declaration. local to the host. host endian. + */ +typedef struct { + __nbrune_t re_min; /* First rune of the range */ + __nbrune_t re_max; /* Last rune (inclusive) of the range */ + __nbrune_t re_map; /* What first maps to in maps */ + _RuneType *re_rune_types; /* Array of types in range */ +} _NBRuneEntry; + + +typedef struct { + uint32_t rr_nranges; /* Number of ranges stored */ + _NBRuneEntry *rr_rune_ranges; +} _NBRuneRange; + + +/* + * wctrans stuffs. + */ +typedef struct _WCTransEntry { + const char *te_name; + __nbrune_t *te_cached; + _NBRuneRange *te_extmap; +} _WCTransEntry; +#define _WCTRANS_INDEX_LOWER 0 +#define _WCTRANS_INDEX_UPPER 1 +#define _WCTRANS_NINDEXES 2 + +/* + * wctype stuffs. + */ +typedef struct _WCTypeEntry { + const char *te_name; + _RuneType te_mask; +} _WCTypeEntry; +#define _WCTYPE_INDEX_ALNUM 0 +#define _WCTYPE_INDEX_ALPHA 1 +#define _WCTYPE_INDEX_BLANK 2 +#define _WCTYPE_INDEX_CNTRL 3 +#define _WCTYPE_INDEX_DIGIT 4 +#define _WCTYPE_INDEX_GRAPH 5 +#define _WCTYPE_INDEX_LOWER 6 +#define _WCTYPE_INDEX_PRINT 7 +#define _WCTYPE_INDEX_PUNCT 8 +#define _WCTYPE_INDEX_SPACE 9 +#define _WCTYPE_INDEX_UPPER 10 +#define _WCTYPE_INDEX_XDIGIT 11 +#define _WCTYPE_NINDEXES 12 + +/* + * ctype stuffs + */ + +typedef struct _NBRuneLocale { + /* + * copied from _FileRuneLocale + */ + char rl_magic[8]; /* Magic saying what version we are */ + char rl_encoding[32];/* ASCII name of this encoding */ + __nbrune_t rl_invalid_rune; + _RuneType rl_runetype[_NB_CACHED_RUNES]; + __nbrune_t rl_maplower[_NB_CACHED_RUNES]; + __nbrune_t rl_mapupper[_NB_CACHED_RUNES]; + _NBRuneRange rl_runetype_ext; + _NBRuneRange rl_maplower_ext; + _NBRuneRange rl_mapupper_ext; + + void *rl_variable; + size_t rl_variable_len; + + /* + * the following portion is generated on the fly + */ + const char *rl_codeset; + struct _citrus_ctype_rec *rl_citrus_ctype; + _WCTransEntry rl_wctrans[_WCTRANS_NINDEXES]; + _WCTypeEntry rl_wctype[_WCTYPE_NINDEXES]; + + const unsigned char *rl_ctype_tab; + const short *rl_tolower_tab; + const short *rl_toupper_tab; +} _NBRuneLocale; + + +/* magic number for LC_CTYPE (rune)locale declaration */ +#define _NB_RUNE_MAGIC_1 "RuneCT10" /* Indicates version 0 of RuneLocale */ + +/* magic string for dynamic link module - type should be like "LC_CTYPE" */ +#define _NB_RUNE_MODULE_1(type) "RuneModule10." type + +/* codeset tag */ +#define _NB_RUNE_CODESET "CODESET=" + +#endif /* !_NB_RUNETYPE_H_ */ Index: lib/libc/stdio/fparseln.c =================================================================== RCS file: /cvsroot/src/lib/libc/stdio/fparseln.c,v retrieving revision 1.7 diff -u -r1.7 fparseln.c --- lib/libc/stdio/fparseln.c 8 Mar 2007 19:57:53 -0000 1.7 +++ lib/libc/stdio/fparseln.c 4 Jan 2009 14:15:21 -0000 @@ -46,7 +46,7 @@ __weak_alias(fparseln,_fparseln) #endif -#if ! HAVE_FPARSELN +#if ! HAVE_FPARSELN || BROKEN_FPARSELN #ifndef HAVE_NBTOOL_CONFIG_H #include "reentrant.h" @@ -251,4 +251,4 @@ */ #endif /* TEST */ -#endif /* ! HAVE_FPARSELN */ +#endif /* ! HAVE_FPARSELN || BROKEN_FPARSELN */ Index: lib/libc/string/wcscmp.c =================================================================== RCS file: /cvsroot/src/lib/libc/string/wcscmp.c,v retrieving revision 1.6 diff -u -r1.6 wcscmp.c --- lib/libc/string/wcscmp.c 2 Jan 2009 00:20:21 -0000 1.6 +++ lib/libc/string/wcscmp.c 4 Jan 2009 14:15:21 -0000 @@ -43,7 +43,7 @@ #include #include -#include "runetype.h" +#include "runetype_local.h" /* * Compare strings. Index: lib/libc/string/wcsncmp.c =================================================================== RCS file: /cvsroot/src/lib/libc/string/wcsncmp.c,v retrieving revision 1.6 diff -u -r1.6 wcsncmp.c --- lib/libc/string/wcsncmp.c 2 Jan 2009 00:20:21 -0000 1.6 +++ lib/libc/string/wcsncmp.c 4 Jan 2009 14:15:21 -0000 @@ -40,7 +40,7 @@ #include #include -#include "runetype.h" +#include "runetype_local.h" int wcsncmp(s1, s2, n) Index: lib/libc/string/wmemcmp.c =================================================================== RCS file: /cvsroot/src/lib/libc/string/wmemcmp.c,v retrieving revision 1.4 diff -u -r1.4 wmemcmp.c --- lib/libc/string/wmemcmp.c 2 Jan 2009 00:20:21 -0000 1.4 +++ lib/libc/string/wmemcmp.c 4 Jan 2009 14:15:21 -0000 @@ -35,7 +35,7 @@ #include #include -#include "runetype.h" +#include "runetype_local.h" int wmemcmp(s1, s2, n) Index: tools/compat/configure =================================================================== RCS file: /cvsroot/src/tools/compat/configure,v retrieving revision 1.67 diff -u -r1.67 configure --- tools/compat/configure 18 Oct 2008 16:27:19 -0000 1.67 +++ tools/compat/configure 4 Jan 2009 14:17:40 -0000 @@ -4980,7 +4980,7 @@ fi for ac_func in atoll asprintf asnprintf basename devname dirfd dirname \ - esetfunc fgetln flock fparseln futimes getopt getopt_long \ + esetfunc fgetln flock futimes getopt getopt_long \ group_from_gid gid_from_group \ heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \ mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb pwrite \ @@ -7496,6 +7496,139 @@ fi +for ac_func in fparseln +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:7502: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 7508 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7539: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7542: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7545: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7548: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:7558: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking if fparseln seems to work... $ECHO_C" >&6 + if test "$cross_compiling" = yes; then + { echo "$as_me:7568: WARNING: cross compiling: not checking farseln" >&5 +echo "$as_me: WARNING: cross compiling: not checking farseln" >&2;} + +else + cat >conftest.$ac_ext <<_ACEOF +#line 7573 "configure" +#include "confdefs.h" + +#define _NETBSD_SOURCE +#include +#include +#define CONFTEST "conftest.fparseln" +#define COMMENT '#' +int +main(void) +{ + static const char delim[3] = { '\0', '\0', COMMENT }; + FILE *fp; + char *ptr; + fp = fopen(CONFTEST, "w+"); + if (fp != NULL) { + unlink(CONFTEST); + ungetc(COMMENT, fp); + ptr = fparseln(fp, NULL, NULL, delim, + FPARSELN_UNESCALL); + fclose(fp); + if (ptr == NULL) + exit(0); + } + exit(1); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:7602: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7605: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:7607: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7610: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:7612: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:7618: result: no" >&5 +echo "${ECHO_T}no" >&6 + +cat >>confdefs.h <<\EOF +#define BROKEN_FPARSELN 1 +EOF + +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + +fi +done + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -7575,7 +7708,7 @@ : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:7578: creating $CONFIG_STATUS" >&5 +{ echo "$as_me:7711: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL @@ -7747,7 +7880,7 @@ echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header - { { echo "$as_me:7750: error: ambiguous option: $1 + { { echo "$as_me:7883: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} @@ -7766,7 +7899,7 @@ ac_need_defaults=false;; # This is an error. - -*) { { echo "$as_me:7769: error: unrecognized option: $1 + -*) { { echo "$as_me:7902: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} @@ -7803,7 +7936,7 @@ # Handling of arguments. "defs.mk" ) CONFIG_FILES="$CONFIG_FILES defs.mk" ;; "nbtool_config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS nbtool_config.h" ;; - *) { { echo "$as_me:7806: error: invalid argument: $ac_config_target" >&5 + *) { { echo "$as_me:7939: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac @@ -8003,7 +8136,7 @@ esac if test x"$ac_file" != x-; then - { echo "$as_me:8006: creating $ac_file" >&5 + { echo "$as_me:8139: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi @@ -8021,7 +8154,7 @@ -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:8024: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:8157: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -8034,7 +8167,7 @@ echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:8037: error: cannot find input file: $f" >&5 + { { echo "$as_me:8170: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -8094,7 +8227,7 @@ * ) ac_file_in=$ac_file.in ;; esac - test x"$ac_file" != x- && { echo "$as_me:8097: creating $ac_file" >&5 + test x"$ac_file" != x- && { echo "$as_me:8230: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the @@ -8105,7 +8238,7 @@ -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:8108: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:8241: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -8118,7 +8251,7 @@ echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:8121: error: cannot find input file: $f" >&5 + { { echo "$as_me:8254: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -8235,7 +8368,7 @@ rm -f $tmp/in if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then - { echo "$as_me:8238: $ac_file is unchanged" >&5 + { echo "$as_me:8371: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ Index: tools/compat/configure.ac =================================================================== RCS file: /cvsroot/src/tools/compat/configure.ac,v retrieving revision 1.67 diff -u -r1.67 configure.ac --- tools/compat/configure.ac 18 Oct 2008 16:25:04 -0000 1.67 +++ tools/compat/configure.ac 4 Jan 2009 14:17:40 -0000 @@ -145,7 +145,7 @@ # Library functions (where a .h check isn't enough). AC_FUNC_ALLOCA AC_CHECK_FUNCS(atoll asprintf asnprintf basename devname dirfd dirname \ - esetfunc fgetln flock fparseln futimes getopt getopt_long \ + esetfunc fgetln flock futimes getopt getopt_long \ group_from_gid gid_from_group \ heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \ mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb pwrite \ @@ -189,4 +189,40 @@ AC_CHECK_LIB(regex, regfree) AC_SEARCH_LIBS(regfree, rx posix) +AC_CHECK_FUNCS(fparseln, [ + AC_MSG_CHECKING(if fparseln seems to work) + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#define _NETBSD_SOURCE +#include +#include +#define CONFTEST "conftest.fparseln" +#define COMMENT '#' +int +main(void) +{ + static const char delim[3] = { '\0', '\0', COMMENT }; + FILE *fp; + char *ptr; + fp = fopen(CONFTEST, "w+"); + if (fp != NULL) { + unlink(CONFTEST); + ungetc(COMMENT, fp); + ptr = fparseln(fp, NULL, NULL, delim, + FPARSELN_UNESCALL); + fclose(fp); + if (ptr == NULL) + exit(0); + } + exit(1); +} + ]])], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + AC_DEFINE(BROKEN_FPARSELN, 1, + [Define to 1 if your `fparseln' function is broken.])], + [AC_MSG_WARN([cross compiling: not checking farseln])] + ) +]) + AC_OUTPUT Index: tools/compat/nbtool_config.h.in =================================================================== RCS file: /cvsroot/src/tools/compat/nbtool_config.h.in,v retrieving revision 1.21 diff -u -r1.21 nbtool_config.h.in --- tools/compat/nbtool_config.h.in 18 Oct 2008 16:27:19 -0000 1.21 +++ tools/compat/nbtool_config.h.in 4 Jan 2009 14:17:42 -0000 @@ -1,10 +1,13 @@ /* nbtool_config.h.in. Generated automatically from configure.ac by autoheader. */ -/* $NetBSD: nbtool_config.h.in,v 1.21 2008/10/18 16:27:19 tsutsui Exp $ */ +/* $NetBSD: configure.ac,v 1.67 2008/10/18 16:25:04 tsutsui Exp $ */ #ifndef __NETBSD_NBTOOL_CONFIG_H__ #define __NETBSD_NBTOOL_CONFIG_H__ +/* Define to 1 if your `fparseln' function is broken. */ +#undef BROKEN_FPARSELN + /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ Index: usr.bin/mklocale/Makefile =================================================================== RCS file: /cvsroot/src/usr.bin/mklocale/Makefile,v retrieving revision 1.14 diff -u -r1.14 Makefile --- usr.bin/mklocale/Makefile 2 Jan 2009 22:16:14 -0000 1.14 +++ usr.bin/mklocale/Makefile 4 Jan 2009 14:17:51 -0000 @@ -8,18 +8,14 @@ PROG= mklocale SRCS= yacc.y lex.l mklocaledb.c fix_grouping.c \ - citrus_bcs_strtoul.c citrus_db_factory.c citrus_db_hash.c \ - fparseln.c + citrus_bcs_strtoul.c citrus_db_factory.c citrus_db_hash.c CPPFLAGS+= -I. -I${.CURDIR} \ - -I${NETBSDSRCDIR}/lib/libc \ -I${NETBSDSRCDIR}/lib/libc/include \ -I${NETBSDSRCDIR}/lib/libc/locale \ -I${NETBSDSRCDIR}/lib/libc/citrus \ -DNBCHAR_MAX=127 -DHOSTPROG CPPFLAGS.citrus_bcs_strtoul.c+= \ -I${NETBSDSRCDIR}/common/lib/libc/stdlib -CPPFLAGS.fparseln.c+= \ - -I${NETBSDSRCDIR}/lib/libc/stdio YHEADER= 1 .ifndef HOSTPROG Index: usr.bin/mklocale/lex.l =================================================================== RCS file: /cvsroot/src/usr.bin/mklocale/lex.l,v retrieving revision 1.15 diff -u -r1.15 lex.l --- usr.bin/mklocale/lex.l 2 Jan 2009 22:08:19 -0000 1.15 +++ usr.bin/mklocale/lex.l 4 Jan 2009 14:17:51 -0000 @@ -46,12 +46,12 @@ #endif #endif /* not lint */ -#include "locale/rune.h" +#include "runetype_local.h" #include #include -#include "citrus/citrus_namespace.h" -#include "citrus/citrus_bcs.h" +#include "citrus_namespace.h" +#include "citrus_bcs.h" #include "ldef.h" #include "yacc.h" Index: usr.bin/mklocale/mklocaledb.c =================================================================== RCS file: /cvsroot/src/usr.bin/mklocale/mklocaledb.c,v retrieving revision 1.1 diff -u -r1.1 mklocaledb.c --- usr.bin/mklocale/mklocaledb.c 2 Jan 2009 00:20:23 -0000 1.1 +++ usr.bin/mklocale/mklocaledb.c 4 Jan 2009 14:17:51 -0000 @@ -31,15 +31,15 @@ * don't waste your time, all we need is localedef(1). */ +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include #if !defined(lint) __RCSID("$NetBSD: mklocaledb.c,v 1.1 2009/01/02 00:20:23 tnozaki Exp $"); #endif /* not lint */ -#if HAVE_NBTOOL_CONFIG_H -#include "nbtool_config.h" -#endif - #include #include #include Index: usr.bin/mklocale/yacc.y =================================================================== RCS file: /cvsroot/src/usr.bin/mklocale/yacc.y,v retrieving revision 1.26 diff -u -r1.26 yacc.y --- usr.bin/mklocale/yacc.y 2 Jan 2009 22:08:19 -0000 1.26 +++ usr.bin/mklocale/yacc.y 4 Jan 2009 14:17:53 -0000 @@ -52,7 +52,7 @@ #include /* Needed for htonl on POSIX systems. */ #include -#include "locale/rune.h" +#include "runetype_local.h" #include #include #include