Source-Changes-HG archive

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

[src/perseant-stdc-iso10646]: src/lib/libc/citrus Make the compilation condit...



details:   https://anonhg.NetBSD.org/src/rev/58f2e0472eef
branches:  perseant-stdc-iso10646
changeset: 850678:58f2e0472eef
user:      perseant <perseant%NetBSD.org@localhost>
date:      Mon Jul 31 04:23:35 2017 +0000

description:
Make the compilation conditional on __STDC_ISO_10646__, so that applications
that need one of the East Asian locales but don't want __STDC_ISO_10646__
don't have to pay the penalty for it.

diffstat:

 lib/libc/citrus/citrus_ctype.h           |   9 ++++++++-
 lib/libc/citrus/citrus_ctype_template.h  |  10 ++++++++--
 lib/libc/citrus/modules/citrus_big5.c    |   8 ++++++--
 lib/libc/citrus/modules/citrus_euc.c     |   8 ++++++--
 lib/libc/citrus/modules/citrus_iso2022.c |  10 ++++++----
 lib/libc/citrus/modules/citrus_mskanji.c |   8 ++++++--
 6 files changed, 40 insertions(+), 13 deletions(-)

diffs (232 lines):

diff -r 7ae4530d7a60 -r 58f2e0472eef lib/libc/citrus/citrus_ctype.h
--- a/lib/libc/citrus/citrus_ctype.h    Sun Jul 23 19:16:11 2017 +0000
+++ b/lib/libc/citrus/citrus_ctype.h    Mon Jul 31 04:23:35 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: citrus_ctype.h,v 1.3.22.1 2017/07/21 20:22:29 perseant Exp $   */
+/*     $NetBSD: citrus_ctype.h,v 1.3.22.2 2017/07/31 04:23:35 perseant Exp $   */
 
 /*-
  * Copyright (c)2002 Citrus Project,
@@ -30,6 +30,7 @@
 #ifndef _CITRUS_CTYPE_H_
 #define _CITRUS_CTYPE_H_
 
+#include <wchar.h> /* For __STDC_ISO_10646__ */
 #include "citrus_ctype_local.h"
 
 typedef struct _citrus_ctype_rec *_citrus_ctype_t;
@@ -185,6 +186,7 @@
        return (*cc->cc_ops->co_wctob)(cc, c, cresult);
 }
 
+#ifdef __STDC_ISO_10646__
 static __inline int
 _citrus_ctype_ucs2kt(_citrus_ctype_t cc,
                      wchar_kuten_t * __restrict ktp,
@@ -202,6 +204,11 @@
        _DIAGASSERT(cc && cc->cc_ops && cc->cc_ops->co_kt2ucs);
        return (*cc->cc_ops->co_kt2ucs)(cc->cc_closure, up, kt);
 }
+#else
+/* Define away the calls to these functions */
+#define _citrus_ctype_ucs2kt(cl, ktp, wc) do {} while (0)
+#define _citrus_ctype_kt2ucs(cl, up, kt) do {} while (0)
+#endif
 
 extern _citrus_ctype_rec_t _citrus_ctype_default;
 
diff -r 7ae4530d7a60 -r 58f2e0472eef lib/libc/citrus/citrus_ctype_template.h
--- a/lib/libc/citrus/citrus_ctype_template.h   Sun Jul 23 19:16:11 2017 +0000
+++ b/lib/libc/citrus/citrus_ctype_template.h   Mon Jul 31 04:23:35 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: citrus_ctype_template.h,v 1.36.22.1 2017/07/21 20:22:29 perseant Exp $ */
+/*     $NetBSD: citrus_ctype_template.h,v 1.36.22.2 2017/07/31 04:23:35 perseant Exp $ */
 
 /*-
  * Copyright (c)2002 Citrus Project,
@@ -118,6 +118,7 @@
  *
  */
 
+#include <wchar.h> /* For __STDC_ISO_10646__ */
 
 /* prototypes */
 
@@ -938,6 +939,7 @@
        return 0;
 }
 
+#ifdef __STDC_ISO_10646__
 static __inline int
 /*ARGSUSED*/
 _FUNCNAME(ctype_ucs2kt)(void * __restrict cl,
@@ -953,4 +955,8 @@
 {
        return _FUNCNAME(kt2ucs)(_CEI_TO_EI(_TO_CEI(cl)), up, kt);
 }
-
+#else
+/* Define away the calls to these functions */
+#define _FUNCNAME(ctype_ucs2kt)(cl, ktp, wc) do {} while (0)
+#define _FUNCNAME(ctype_kt2ucs)(cl, up, kt) do {} while (0)
+#endif
diff -r 7ae4530d7a60 -r 58f2e0472eef lib/libc/citrus/modules/citrus_big5.c
--- a/lib/libc/citrus/modules/citrus_big5.c     Sun Jul 23 19:16:11 2017 +0000
+++ b/lib/libc/citrus/modules/citrus_big5.c     Mon Jul 31 04:23:35 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: citrus_big5.c,v 1.15.18.2 2017/07/21 20:22:29 perseant Exp $   */
+/*     $NetBSD: citrus_big5.c,v 1.15.18.3 2017/07/31 04:23:35 perseant Exp $   */
 
 /*-
  * Copyright (c)2002, 2006 Citrus Project,
@@ -60,7 +60,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_big5.c,v 1.15.18.2 2017/07/21 20:22:29 perseant Exp $");
+__RCSID("$NetBSD: citrus_big5.c,v 1.15.18.3 2017/07/31 04:23:35 perseant Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/queue.h>
@@ -134,6 +134,7 @@
 #define _ENCODING_IS_STATE_DEPENDENT   0
 #define _STATE_NEEDS_EXPLICIT_INIT(_ps_)       0
 
+#ifdef __STDC_ISO_10646__
 #include "citrus_big5_data.h"
 
 static __inline int
@@ -188,6 +189,9 @@
 
        return 0;
 }
+#else
+#include "citrus_u2k_template.h"
+#endif
 
 static __inline void
 /*ARGSUSED*/
diff -r 7ae4530d7a60 -r 58f2e0472eef lib/libc/citrus/modules/citrus_euc.c
--- a/lib/libc/citrus/modules/citrus_euc.c      Sun Jul 23 19:16:11 2017 +0000
+++ b/lib/libc/citrus/modules/citrus_euc.c      Mon Jul 31 04:23:35 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: citrus_euc.c,v 1.17.20.2 2017/07/21 20:22:29 perseant Exp $    */
+/*     $NetBSD: citrus_euc.c,v 1.17.20.3 2017/07/31 04:23:35 perseant Exp $    */
 
 /*-
  * Copyright (c)2002 Citrus Project,
@@ -60,7 +60,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_euc.c,v 1.17.20.2 2017/07/21 20:22:29 perseant Exp $");
+__RCSID("$NetBSD: citrus_euc.c,v 1.17.20.3 2017/07/31 04:23:35 perseant Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <assert.h>
@@ -129,6 +129,7 @@
 #define _ENCODING_IS_STATE_DEPENDENT   0
 #define _STATE_NEEDS_EXPLICIT_INIT(_ps_)       0
 
+#ifdef __STDC_ISO_10646__
 #include "citrus_euc_data.h"
 
 static __inline int
@@ -183,6 +184,9 @@
 
        return 0;
 }
+#else
+#include "citrus_u2k_template.h"
+#endif
 
 static __inline int
 _citrus_EUC_cs(unsigned int c)
diff -r 7ae4530d7a60 -r 58f2e0472eef lib/libc/citrus/modules/citrus_iso2022.c
--- a/lib/libc/citrus/modules/citrus_iso2022.c  Sun Jul 23 19:16:11 2017 +0000
+++ b/lib/libc/citrus/modules/citrus_iso2022.c  Mon Jul 31 04:23:35 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: citrus_iso2022.c,v 1.23.22.2 2017/07/21 20:22:29 perseant Exp $        */
+/*     $NetBSD: citrus_iso2022.c,v 1.23.22.3 2017/07/31 04:23:35 perseant Exp $        */
 
 /*-
  * Copyright (c)1999, 2002 Citrus Project,
@@ -30,7 +30,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_iso2022.c,v 1.23.22.2 2017/07/21 20:22:29 perseant Exp $");
+__RCSID("$NetBSD: citrus_iso2022.c,v 1.23.22.3 2017/07/31 04:23:35 perseant Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <assert.h>
@@ -164,6 +164,7 @@
 static __inline int isinterm(__uint8_t x) { return (0x20 <= x && x <= 0x2f); }
 static __inline int isthree(__uint8_t x) { return (0x60 <= x && x <= 0x6f); }
 
+#ifdef __STDC_ISO_10646__
 #include "citrus_iso2022_data.h"
 
 static __inline int
@@ -171,7 +172,6 @@
 _FUNCNAME(ucs2kt)(_ENCODING_INFO * __restrict ei,
                  wchar_kuten_t * __restrict ktp, wchar_ucs4_t wc)
 {
-
        _DIAGASSERT(ktp != NULL);
 
        /* US-ASCII are not in the list */
@@ -195,7 +195,6 @@
 _FUNCNAME(kt2ucs)(_ENCODING_INFO * __restrict ei,
                  wchar_ucs4_t * __restrict up, wchar_kuten_t kt)
 {
-
        _DIAGASSERT(up != NULL);
 
        /* US-ASCII are not in the list */
@@ -213,6 +212,9 @@
 
        return 0;
 }
+#else
+#include "citrus_u2k_template.h"
+#endif
 
 static __inline int
 getcs(const char * __restrict p, _ISO2022Charset * __restrict cs)
diff -r 7ae4530d7a60 -r 58f2e0472eef lib/libc/citrus/modules/citrus_mskanji.c
--- a/lib/libc/citrus/modules/citrus_mskanji.c  Sun Jul 23 19:16:11 2017 +0000
+++ b/lib/libc/citrus/modules/citrus_mskanji.c  Mon Jul 31 04:23:35 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: citrus_mskanji.c,v 1.14.22.2 2017/07/21 20:22:29 perseant Exp $        */
+/*     $NetBSD: citrus_mskanji.c,v 1.14.22.3 2017/07/31 04:23:35 perseant Exp $        */
 
 /*-
  * Copyright (c)2002 Citrus Project,
@@ -62,7 +62,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_mskanji.c,v 1.14.22.2 2017/07/21 20:22:29 perseant Exp $");
+__RCSID("$NetBSD: citrus_mskanji.c,v 1.14.22.3 2017/07/31 04:23:35 perseant Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <assert.h>
@@ -126,6 +126,7 @@
 #define _ENCODING_IS_STATE_DEPENDENT   0
 #define _STATE_NEEDS_EXPLICIT_INIT(_ps_)       0
 
+#ifdef __STDC_ISO_10646__
 #include "citrus_mskanji_data.h"
 
 static __inline int
@@ -189,6 +190,9 @@
 
        return 0;
 }
+#else
+#include "citrus_u2k_template.h"
+#endif
 
 static int
 _mskanji1(int c)



Home | Main Index | Thread Index | Old Index