diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-07-05 09:03:12 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-07-05 09:03:12 (GMT) |
commit | 30b0dabb9b5092b7453ff56eae75c009f30eaa1f (patch) | |
tree | e95abf5ef1adf6677e12d167fb247fc671a8d556 /unix | |
parent | 26a830241ea90ce41d6cddc8f2a720f4cc5b2e73 (diff) | |
download | tcl-30b0dabb9b5092b7453ff56eae75c009f30eaa1f.zip tcl-30b0dabb9b5092b7453ff56eae75c009f30eaa1f.tar.gz tcl-30b0dabb9b5092b7453ff56eae75c009f30eaa1f.tar.bz2 |
Improvement: always export both 16-bit and 32-bit UTF function
Diffstat (limited to 'unix')
-rwxr-xr-x | unix/configure | 39 | ||||
-rw-r--r-- | unix/configure.ac | 16 | ||||
-rw-r--r-- | unix/tclUnixInit.c | 2 | ||||
-rw-r--r-- | unix/tclUnixTime.c | 1 |
4 files changed, 55 insertions, 3 deletions
diff --git a/unix/configure b/unix/configure index 2de5b54..a35cde4 100755 --- a/unix/configure +++ b/unix/configure @@ -3930,6 +3930,45 @@ done #------------------------------------------------------------------------ +# If we're using GCC, see if the compiler understands -fshort-wchar. If so, use it. +# It makes sure you can use the wchar_t type interchangable with Tcl_UniChar +#------------------------------------------------------------------------ + +if test -z "$no_short_wchar" && test -n "$GCC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -fshort-wchar" >&5 +$as_echo_n "checking if the compiler understands -fshort-wchar... " >&6; } +if ${tcl_cv_cc_short_wchar+:} false; then : + $as_echo_n "(cached) " >&6 +else + + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fshort-wchar" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + tcl_cv_cc_short_wchar=yes +else + tcl_cv_cc_short_wchar=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$hold_cflags +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_short_wchar" >&5 +$as_echo "$tcl_cv_cc_short_wchar" >&6; } + if test $tcl_cv_cc_short_wchar = yes; then + CFLAGS="$CFLAGS -fshort-wchar" + fi +fi + +#------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) #------------------------------------------------------------------------ diff --git a/unix/configure.ac b/unix/configure.ac index 74dbe08..3a9bdd0 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -105,6 +105,22 @@ SC_MISSING_POSIX_HEADERS AC_EXEEXT #------------------------------------------------------------------------ +# If we're using GCC, see if the compiler understands -fshort-wchar. If so, use it. +# It makes sure you can use the wchar_t type interchangable with Tcl_UniChar +#------------------------------------------------------------------------ + +if test -z "$no_short_wchar" && test -n "$GCC"; then + AC_CACHE_CHECK([if the compiler understands -fshort-wchar], + tcl_cv_cc_short_wchar, [ + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fshort-wchar" + AC_TRY_COMPILE(,, tcl_cv_cc_short_wchar=yes, tcl_cv_cc_short_wchar=no) + CFLAGS=$hold_cflags]) + if test $tcl_cv_cc_short_wchar = yes; then + CFLAGS="$CFLAGS -fshort-wchar" + fi +fi + +#------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) #------------------------------------------------------------------------ diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index b6b66da..187ef34 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -9,8 +9,6 @@ */ #include "tclInt.h" -#include <stddef.h> -#include <locale.h> #ifdef HAVE_LANGINFO # include <langinfo.h> # ifdef __APPLE__ diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c index 1d8b351..51d486e 100644 --- a/unix/tclUnixTime.c +++ b/unix/tclUnixTime.c @@ -11,7 +11,6 @@ */ #include "tclInt.h" -#include <locale.h> #if defined(TCL_WIDE_CLICKS) && defined(MAC_OSX_TCL) #include <mach/mach_time.h> #endif |