Source-Changes-HG archive

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

[src/trunk]: src changes for cross build on FreeBSD box.



details:   https://anonhg.NetBSD.org/src/rev/fdfe98e81d5e
branches:  trunk
changeset: 544105:fdfe98e81d5e
user:      tshiozak <tshiozak%NetBSD.org@localhost>
date:      Tue Mar 11 17:23:07 2003 +0000

description:
changes for cross build on FreeBSD box.
 - rename some macros and types defined in runetype.h.
 - move declarations of some global symbols to rune.h from runetype.h.
 - make sure the target sources use rune.h and mklocale use runetype.h.
I tested them on FreeBSD-4.6.2 box (./build.sh -m i386 tools).

diffstat:

 lib/libc/locale/_wctrans.c    |   5 +-
 lib/libc/locale/rune.h        |  27 ++++++++++++++++-
 lib/libc/locale/runetype.h    |  69 +++++++++++++++++++-----------------------
 lib/libc/locale/setlocale1.c  |   6 +-
 lib/libc/locale/setlocale32.c |   6 +-
 usr.bin/mklocale/ldef.h       |  10 +++---
 usr.bin/mklocale/yacc.y       |  36 +++++++++++-----------
 7 files changed, 88 insertions(+), 71 deletions(-)

diffs (truncated from 408 to 300 lines):

diff -r 932d5c848744 -r fdfe98e81d5e lib/libc/locale/_wctrans.c
--- a/lib/libc/locale/_wctrans.c        Tue Mar 11 16:44:00 2003 +0000
+++ b/lib/libc/locale/_wctrans.c        Tue Mar 11 17:23:07 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: _wctrans.c,v 1.2 2003/03/04 15:09:54 yamt Exp $        */
+/*     $NetBSD: _wctrans.c,v 1.3 2003/03/11 17:23:07 tshiozak Exp $    */
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -64,7 +64,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: _wctrans.c,v 1.2 2003/03/04 15:09:54 yamt Exp $");
+__RCSID("$NetBSD: _wctrans.c,v 1.3 2003/03/11 17:23:07 tshiozak Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -73,7 +73,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include "rune.h"
-#include "runetype.h"
 #include "rune_local.h"
 #include "_wctrans_local.h"
 
diff -r 932d5c848744 -r fdfe98e81d5e lib/libc/locale/rune.h
--- a/lib/libc/locale/rune.h    Tue Mar 11 16:44:00 2003 +0000
+++ b/lib/libc/locale/rune.h    Tue Mar 11 17:23:07 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rune.h,v 1.7 2003/03/10 21:18:49 tshiozak Exp $        */
+/*     $NetBSD: rune.h,v 1.8 2003/03/11 17:23:07 tshiozak Exp $        */
 
 /*-
  * Copyright (c) 1993
@@ -73,4 +73,29 @@
 #define        _CTYPE_SW2      _RUNETYPE_SW2
 #define        _CTYPE_SW3      _RUNETYPE_SW3
 
+/*
+ * Other namespace conversion.
+ */
+
+#define rune_t                 __nbrune_t
+#define _RUNE_ISCACHED         _NB_RUNE_ISCACHED
+#define _CACHED_RUNES          _NB_CACHED_RUNES
+#define _DEFAULT_INVALID_RUNE  _NB_DEFAULT_INVALID_RUNE
+#define _RuneEntry             _NBRuneEntry
+#define _RuneRange             _NBRuneRange
+#define _RuneLocale            _NBRuneLocale
+#define _RUNE_MAGIC_1          _NB_RUNE_MAGIC_1
+#define _RUNE_MODULE_1         _NB_RUNE_MODULE_1
+#define _RUNE_CODESET          _NB_RUNE_CODESET
+
+/*
+ * global variables
+ */
+extern size_t __mb_len_max_runtime;
+#define __MB_LEN_MAX_RUNTIME   __mb_len_max_runtime
+
+extern _RuneLocale _DefaultRuneLocale;
+extern _RuneLocale *_CurrentRuneLocale;
+extern char *_PathLocale;
+
 #endif /*! _RUNE_H_ */
diff -r 932d5c848744 -r fdfe98e81d5e lib/libc/locale/runetype.h
--- a/lib/libc/locale/runetype.h        Tue Mar 11 16:44:00 2003 +0000
+++ b/lib/libc/locale/runetype.h        Tue Mar 11 17:23:07 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: runetype.h,v 1.15 2003/03/10 21:18:50 tshiozak Exp $   */
+/*     $NetBSD: runetype.h,v 1.16 2003/03/11 17:23:07 tshiozak Exp $   */
 
 /*-
  * Copyright (c) 1993
@@ -38,8 +38,8 @@
  *     @(#)runetype.h  8.1 (Berkeley) 6/2/93
  */
 
-#ifndef        _RUNETYPE_H_
-#define        _RUNETYPE_H_
+#ifndef        _NB_RUNETYPE_H_
+#define        _NB_RUNETYPE_H_
 
 #include <sys/cdefs.h>
 #include <sys/types.h>
@@ -50,16 +50,13 @@
 #define UINT32_C(c) ((uint32_t)(c##U))
 #endif
 
-typedef int32_t                rune_t;
+typedef int32_t                __nbrune_t;
 typedef uint64_t       __runepad_t;
 
-extern size_t __mb_len_max_runtime;
-#define __MB_LEN_MAX_RUNTIME   __mb_len_max_runtime
+#define        _NB_CACHED_RUNES        (1 << 8)        /* Must be a power of 2 */
+#define _NB_RUNE_ISCACHED(c)   ((c)>=0 && (c)<_CACHED_RUNES)
 
-#define        _CACHED_RUNES           (1 << 8)        /* Must be a power of 2 */
-#define _RUNE_ISCACHED(c)      ((c)>=0 && (c)<_CACHED_RUNES)
-
-#define _DEFAULT_INVALID_RUNE  ((rune_t)-3)
+#define _NB_DEFAULT_INVALID_RUNE ((__nbrune_t)-3)
 
 /*
  * The lower 8 bits of runetype[] contain the digit value of the rune.
@@ -115,9 +112,9 @@
        int32_t         frl_invalid_rune;
        uint32_t        frl_pad3;       /* backward compatibility */
 
-       _RuneType       frl_runetype[_CACHED_RUNES];
-       int32_t         frl_maplower[_CACHED_RUNES];
-       int32_t         frl_mapupper[_CACHED_RUNES];
+       _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.
@@ -140,17 +137,17 @@
  * expanded rune locale declaration.  local to the host.  host endian.
  */
 typedef struct {
-       rune_t          re_min;         /* First rune of the range */
-       rune_t          re_max;         /* Last rune (inclusive) of the range */
-       rune_t          re_map;         /* What first maps to in maps */
+       __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 */
-} _RuneEntry;
+} _NBRuneEntry;
 
 
 typedef struct {
        uint32_t        rr_nranges;     /* Number of ranges stored */
-       _RuneEntry      *rr_rune_ranges;
-} _RuneRange;
+       _NBRuneEntry    *rr_rune_ranges;
+} _NBRuneRange;
 
 
 /*
@@ -158,8 +155,8 @@
  */
 typedef struct _WCTransEntry {
        char            *te_name;
-       rune_t          *te_cached;
-       _RuneRange      *te_extmap;
+       __nbrune_t      *te_cached;
+       _NBRuneRange    *te_extmap;
 } _WCTransEntry;
 #define _WCTRANS_INDEX_LOWER   0
 #define _WCTRANS_INDEX_UPPER   1
@@ -190,19 +187,19 @@
  * ctype stuffs
  */
 
-typedef struct _RuneLocale {
+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 */
-       rune_t          rl_invalid_rune;
-       _RuneType       rl_runetype[_CACHED_RUNES];
-       rune_t          rl_maplower[_CACHED_RUNES];
-       rune_t          rl_mapupper[_CACHED_RUNES];
-       _RuneRange      rl_runetype_ext;
-       _RuneRange      rl_maplower_ext;
-       _RuneRange      rl_mapupper_ext;
+       __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;
@@ -214,20 +211,16 @@
        struct _citrus_ctype_rec        *rl_citrus_ctype;
        _WCTransEntry                   rl_wctrans[_WCTRANS_NINDEXES];
        _WCTypeEntry                    rl_wctype[_WCTYPE_NINDEXES];
-} _RuneLocale;
+} _NBRuneLocale;
 
 
 /* magic number for LC_CTYPE (rune)locale declaration */
-#define        _RUNE_MAGIC_1   "RuneCT10"      /* Indicates version 0 of RuneLocale */
+#define        _NB_RUNE_MAGIC_1 "RuneCT10"     /* Indicates version 0 of RuneLocale */
 
 /* magic string for dynamic link module - type should be like "LC_CTYPE" */
-#define        _RUNE_MODULE_1(type)    "RuneModule10." type
+#define        _NB_RUNE_MODULE_1(type) "RuneModule10." type
 
 /* codeset tag */
-#define _RUNE_CODESET "CODESET="
+#define _NB_RUNE_CODESET "CODESET="
 
-extern _RuneLocale _DefaultRuneLocale;
-extern _RuneLocale *_CurrentRuneLocale;
-extern char *_PathLocale;
-
-#endif /* !_RUNETYPE_H_ */
+#endif /* !_NB_RUNETYPE_H_ */
diff -r 932d5c848744 -r fdfe98e81d5e lib/libc/locale/setlocale1.c
--- a/lib/libc/locale/setlocale1.c      Tue Mar 11 16:44:00 2003 +0000
+++ b/lib/libc/locale/setlocale1.c      Tue Mar 11 17:23:07 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: setlocale1.c,v 1.1 2001/01/25 01:25:07 itojun Exp $    */
+/*     $NetBSD: setlocale1.c,v 1.2 2003/03/11 17:23:07 tshiozak Exp $  */
 
 /*-
  * Copyright (c)1999 Citrus Project,
@@ -28,13 +28,13 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: setlocale1.c,v 1.1 2001/01/25 01:25:07 itojun Exp $");
+__RCSID("$NetBSD: setlocale1.c,v 1.2 2003/03/11 17:23:07 tshiozak Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
 #define __SETLOCALE_SOURCE__
 #include <locale.h>
-#include "runetype.h"
+#include "rune.h"
 
 __warn_references(setlocale,
     "warning: reference to compatibility setlocale(); include <locale.h> for correct reference")
diff -r 932d5c848744 -r fdfe98e81d5e lib/libc/locale/setlocale32.c
--- a/lib/libc/locale/setlocale32.c     Tue Mar 11 16:44:00 2003 +0000
+++ b/lib/libc/locale/setlocale32.c     Tue Mar 11 17:23:07 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: setlocale32.c,v 1.1 2001/01/25 01:25:09 itojun Exp $   */
+/*     $NetBSD: setlocale32.c,v 1.2 2003/03/11 17:23:07 tshiozak Exp $ */
 
 /*-
  * Copyright (c)1999 Citrus Project,
@@ -28,13 +28,13 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: setlocale32.c,v 1.1 2001/01/25 01:25:09 itojun Exp $");
+__RCSID("$NetBSD: setlocale32.c,v 1.2 2003/03/11 17:23:07 tshiozak Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
 #define __SETLOCALE_SOURCE__
 #include <locale.h>
-#include "runetype.h"
+#include "rune.h"
 
 char *
 __setlocale_mb_len_max_32(category, locale)
diff -r 932d5c848744 -r fdfe98e81d5e usr.bin/mklocale/ldef.h
--- a/usr.bin/mklocale/ldef.h   Tue Mar 11 16:44:00 2003 +0000
+++ b/usr.bin/mklocale/ldef.h   Tue Mar 11 17:23:07 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldef.h,v 1.2 2000/12/22 01:31:48 itojun Exp $  */
+/*     $NetBSD: ldef.h,v 1.3 2003/03/11 17:23:08 tshiozak Exp $        */
 
 /*-
  * Copyright (c) 1993
@@ -42,14 +42,14 @@
  * This should look a LOT like a _RuneEntry
  */
 typedef struct rune_list {
-    rune_t             min;
-    rune_t             max;
-    rune_t             map;
+    __nbrune_t         min;
+    __nbrune_t                 max;
+    __nbrune_t                 map;
     u_int32_t          *types;
     struct rune_list   *next;
 } rune_list;
 
 typedef struct rune_map {
-    u_int32_t          map[_CACHED_RUNES];
+    u_int32_t          map[_NB_CACHED_RUNES];
     rune_list          *root;
 } rune_map;
diff -r 932d5c848744 -r fdfe98e81d5e usr.bin/mklocale/yacc.y
--- a/usr.bin/mklocale/yacc.y   Tue Mar 11 16:44:00 2003 +0000
+++ b/usr.bin/mklocale/yacc.y   Tue Mar 11 17:23:07 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: yacc.y,v 1.16 2003/03/10 21:18:50 tshiozak Exp $       */
+/*     $NetBSD: yacc.y,v 1.17 2003/03/11 17:23:08 tshiozak Exp $       */
 
 %{
 /*-
@@ -47,7 +47,7 @@
 static char sccsid[] = "@(#)yacc.y     8.1 (Berkeley) 6/6/93";
 static char rcsid[] = "$FreeBSD$";
 #else
-__RCSID("$NetBSD: yacc.y,v 1.16 2003/03/10 21:18:50 tshiozak Exp $");



Home | Main Index | Thread Index | Old Index