Tk Source Code

Check-in [11cf61f5]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:workaround for _strtoi64 determination on win64 (autoconf-2.13 issue)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-4-branch
Files: files | file ages | folders
SHA1: 11cf61f5bc07f39fdf957240b21764f38f9b9c7c
User & Date: jan.nijtmans 2012-03-15 20:45:42
Context
2012-03-18
21:00
rfe-3503317: XParseColor speedup check-in: 26bdfc04 user: jan.nijtmans tags: core-8-4-branch
2012-03-16
22:36
further reduction of color table to 147 entries! check-in: 7f343b6e user: jan.nijtmans tags: rfe-3503317
2012-03-15
20:46
merge-mark check-in: cb63753f user: jan.nijtmans tags: core-8-5-branch
20:45
workaround for _strtoi64 determination on win64 (autoconf-2.13 issue) check-in: 11cf61f5 user: jan.nijtmans tags: core-8-4-branch
20:10
[bug 3505358 ] invalid color name "#f75df642f527" check-in: 7518016c user: jan.nijtmans tags: core-8-4-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to win/configure.

1748
1749
1750
1751
1752
1753
1754

1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787

1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804



#-------------------------------------------
#     Check for _strtoi64
#-------------------------------------------


echo $ac_n "checking availability of _strtoi64""... $ac_c" 1>&6
echo "configure:1757: checking availability of _strtoi64" >&5
if eval "test \"`echo '$''{'tcl_have_strtoi64'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    cat > conftest.$ac_ext <<EOF
#line 1763 "configure"
#include "confdefs.h"
#include <stdlib.h>
int main() {
_strtoi64(0,0,0)
; return 0; }
EOF
if { (eval echo configure:1770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  tcl_have_strtoi64=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  tcl_have_strtoi64=no
fi
rm -f conftest*
fi

echo "$ac_t""$tcl_have_strtoi64" 1>&6
if test $tcl_have_strtoi64 = no; then
    cat >> confdefs.h <<\EOF
#define NO_STRTOI64 1
EOF

fi


#--------------------------------------------------------------------
# Set the default compiler switches based on the --enable-symbols
# option.  This macro depends on C flags, and should be called
# after SC_CONFIG_CFLAGS macro is called.
#--------------------------------------------------------------------


    echo $ac_n "checking for build with symbols""... $ac_c" 1>&6
echo "configure:1798: checking for build with symbols" >&5
    # Check whether --enable-symbols or --disable-symbols was given.
if test "${enable_symbols+set}" = set; then
  enableval="$enable_symbols"
  tcl_ok=$enableval
else
  tcl_ok=no
fi







>

|





|






|


















>









|







1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806



#-------------------------------------------
#     Check for _strtoi64
#-------------------------------------------

if test "${MACHINE}" = "X86" ; then
echo $ac_n "checking availability of _strtoi64""... $ac_c" 1>&6
echo "configure:1758: checking availability of _strtoi64" >&5
if eval "test \"`echo '$''{'tcl_have_strtoi64'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    cat > conftest.$ac_ext <<EOF
#line 1764 "configure"
#include "confdefs.h"
#include <stdlib.h>
int main() {
_strtoi64(0,0,0)
; return 0; }
EOF
if { (eval echo configure:1771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  tcl_have_strtoi64=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  tcl_have_strtoi64=no
fi
rm -f conftest*
fi

echo "$ac_t""$tcl_have_strtoi64" 1>&6
if test $tcl_have_strtoi64 = no; then
    cat >> confdefs.h <<\EOF
#define NO_STRTOI64 1
EOF

fi
fi

#--------------------------------------------------------------------
# Set the default compiler switches based on the --enable-symbols
# option.  This macro depends on C flags, and should be called
# after SC_CONFIG_CFLAGS macro is called.
#--------------------------------------------------------------------


    echo $ac_n "checking for build with symbols""... $ac_c" 1>&6
echo "configure:1800: checking for build with symbols" >&5
    # Check whether --enable-symbols or --disable-symbols was given.
if test "${enable_symbols+set}" = set; then
  enableval="$enable_symbols"
  tcl_ok=$enableval
else
  tcl_ok=no
fi
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882

#--------------------------------------------------------------------
# Embed the manifest if we can determine how
#--------------------------------------------------------------------


    echo $ac_n "checking whether to embed manifest""... $ac_c" 1>&6
echo "configure:1859: checking whether to embed manifest" >&5
    # Check whether --enable-embedded-manifest or --disable-embedded-manifest was given.
if test "${enable_embedded_manifest+set}" = set; then
  enableval="$enable_embedded_manifest"
  embed_ok=$enableval
else
  embed_ok=yes
fi


	VC_MANIFEST_EMBED_DLL=
	VC_MANIFEST_EMBED_EXE=
    result=no
    if test "$embed_ok" = "yes" -a "${SHARED_BUILD}" = "1" \
       -a "$GCC" != "yes" ; then
	# Add the magic to embed the manifest into the dll/exe
	cat > conftest.$ac_ext <<EOF
#line 1876 "configure"
#include "confdefs.h"

#if defined(_MSC_VER) && _MSC_VER >= 1400
print("manifest needed")
#endif
	
EOF







|
















|







1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884

#--------------------------------------------------------------------
# Embed the manifest if we can determine how
#--------------------------------------------------------------------


    echo $ac_n "checking whether to embed manifest""... $ac_c" 1>&6
echo "configure:1861: checking whether to embed manifest" >&5
    # Check whether --enable-embedded-manifest or --disable-embedded-manifest was given.
if test "${enable_embedded_manifest+set}" = set; then
  enableval="$enable_embedded_manifest"
  embed_ok=$enableval
else
  embed_ok=yes
fi


	VC_MANIFEST_EMBED_DLL=
	VC_MANIFEST_EMBED_EXE=
    result=no
    if test "$embed_ok" = "yes" -a "${SHARED_BUILD}" = "1" \
       -a "$GCC" != "yes" ; then
	# Add the magic to embed the manifest into the dll/exe
	cat > conftest.$ac_ext <<EOF
#line 1878 "configure"
#include "confdefs.h"

#if defined(_MSC_VER) && _MSC_VER >= 1400
print("manifest needed")
#endif
	
EOF
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919

#--------------------------------------------------------------------
# Locate and source the tclConfig.sh file.
#--------------------------------------------------------------------


    echo $ac_n "checking the location of tclConfig.sh""... $ac_c" 1>&6
echo "configure:1913: checking the location of tclConfig.sh" >&5

    if test -d ../../tcl8.4$TK_PATCH_LEVEL/win;  then
	TCL_BIN_DIR_DEFAULT=../../tcl8.4$TK_PATCH_LEVEL/win
    elif test -d ../../tcl8.4/win;  then
	TCL_BIN_DIR_DEFAULT=../../tcl8.4/win
    else
	TCL_BIN_DIR_DEFAULT=../../tcl/win







|







1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921

#--------------------------------------------------------------------
# Locate and source the tclConfig.sh file.
#--------------------------------------------------------------------


    echo $ac_n "checking the location of tclConfig.sh""... $ac_c" 1>&6
echo "configure:1915: checking the location of tclConfig.sh" >&5

    if test -d ../../tcl8.4$TK_PATCH_LEVEL/win;  then
	TCL_BIN_DIR_DEFAULT=../../tcl8.4$TK_PATCH_LEVEL/win
    elif test -d ../../tcl8.4/win;  then
	TCL_BIN_DIR_DEFAULT=../../tcl8.4/win
    else
	TCL_BIN_DIR_DEFAULT=../../tcl/win
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
    if test ! -f $TCL_BIN_DIR/tclConfig.sh; then
	{ echo "configure: error: There is no tclConfig.sh in $TCL_BIN_DIR:  perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?" 1>&2; exit 1; }
    fi
    echo "$ac_t""$TCL_BIN_DIR/tclConfig.sh" 1>&6


    echo $ac_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh""... $ac_c" 1>&6
echo "configure:1941: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5

    if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
        echo "$ac_t""loading" 1>&6
	. $TCL_BIN_DIR/tclConfig.sh
    else
        echo "$ac_t""file not found" 1>&6
    fi







|







1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
    if test ! -f $TCL_BIN_DIR/tclConfig.sh; then
	{ echo "configure: error: There is no tclConfig.sh in $TCL_BIN_DIR:  perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?" 1>&2; exit 1; }
    fi
    echo "$ac_t""$TCL_BIN_DIR/tclConfig.sh" 1>&6


    echo $ac_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh""... $ac_c" 1>&6
echo "configure:1943: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5

    if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
        echo "$ac_t""loading" 1>&6
	. $TCL_BIN_DIR/tclConfig.sh
    else
        echo "$ac_t""file not found" 1>&6
    fi
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
    

    



    echo $ac_n "checking for tclsh in Tcl build directory""... $ac_c" 1>&6
echo "configure:1994: checking for tclsh in Tcl build directory" >&5
    BUILD_TCLSH=${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}
    echo "$ac_t""$BUILD_TCLSH" 1>&6
    


    echo $ac_n "checking for tclsh""... $ac_c" 1>&6
echo "configure:2001: checking for tclsh" >&5

    if eval "test \"`echo '$''{'ac_cv_path_tclsh'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	search_path=`echo ${PATH} | sed -e 's/:/ /g'`
	for dir in $search_path ; do







|






|







1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
    

    



    echo $ac_n "checking for tclsh in Tcl build directory""... $ac_c" 1>&6
echo "configure:1996: checking for tclsh in Tcl build directory" >&5
    BUILD_TCLSH=${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}
    echo "$ac_t""$BUILD_TCLSH" 1>&6
    


    echo $ac_n "checking for tclsh""... $ac_c" 1>&6
echo "configure:2003: checking for tclsh" >&5

    if eval "test \"`echo '$''{'ac_cv_path_tclsh'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	search_path=`echo ${PATH} | sed -e 's/:/ /g'`
	for dir in $search_path ; do

Changes to win/configure.in.

110
111
112
113
114
115
116

117
118
119
120
121
122

123
124
125
126
127
128
129
AC_CHECK_HEADER(errno.h, , MAN2TCLFLAGS="-DNO_ERRNO_H")
AC_SUBST(MAN2TCLFLAGS)

#-------------------------------------------
#     Check for _strtoi64
#-------------------------------------------


AC_CACHE_CHECK([availability of _strtoi64], tcl_have_strtoi64, [
    AC_TRY_LINK([#include <stdlib.h>],
	    [_strtoi64(0,0,0)],
	    tcl_have_strtoi64=yes, tcl_have_strtoi64=no)])
if test $tcl_have_strtoi64 = no; then
    AC_DEFINE(NO_STRTOI64, 1, [Is _strtoi64 function available?])

fi

#--------------------------------------------------------------------
# Set the default compiler switches based on the --enable-symbols
# option.  This macro depends on C flags, and should be called
# after SC_CONFIG_CFLAGS macro is called.
#--------------------------------------------------------------------







>






>







110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
AC_CHECK_HEADER(errno.h, , MAN2TCLFLAGS="-DNO_ERRNO_H")
AC_SUBST(MAN2TCLFLAGS)

#-------------------------------------------
#     Check for _strtoi64
#-------------------------------------------

if test "${MACHINE}" = "X86" ; then
AC_CACHE_CHECK([availability of _strtoi64], tcl_have_strtoi64, [
    AC_TRY_LINK([#include <stdlib.h>],
	    [_strtoi64(0,0,0)],
	    tcl_have_strtoi64=yes, tcl_have_strtoi64=no)])
if test $tcl_have_strtoi64 = no; then
    AC_DEFINE(NO_STRTOI64, 1, [Is _strtoi64 function available?])
fi
fi

#--------------------------------------------------------------------
# Set the default compiler switches based on the --enable-symbols
# option.  This macro depends on C flags, and should be called
# after SC_CONFIG_CFLAGS macro is called.
#--------------------------------------------------------------------

Changes to xlib/xcolors.c.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * xcolors.c --
 *
 *	This file contains the routines used to map from X color names to RGB
 *	and pixel values.
 *
 * Copyright (c) 1996 by Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#include "tkInt.h"
#include <stdlib.h>

/*
 * Forward declarations for functions used only in this file.
 */

static int	FindColor(const char *name, XColor *colorPtr);














<







1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
/*
 * xcolors.c --
 *
 *	This file contains the routines used to map from X color names to RGB
 *	and pixel values.
 *
 * Copyright (c) 1996 by Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#include "tkInt.h"


/*
 * Forward declarations for functions used only in this file.
 */

static int	FindColor(const char *name, XColor *colorPtr);

851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
 *
 *----------------------------------------------------------------------
 */

#ifdef __WIN32__
#   ifdef NO_STRTOI64
/* This version only handles hex-strings without 0x prefix */
#define _strtoi64 something_out_of_the_way /* workaround for win64 problem ??? */
static __int64
_strtoi64(const char *spec, char **p, int base)
{
    __int64 result = 0;
    char c;
    while ((c = *spec)) {
	if ((c >= '0') && (c <= '9')) {







<







850
851
852
853
854
855
856

857
858
859
860
861
862
863
 *
 *----------------------------------------------------------------------
 */

#ifdef __WIN32__
#   ifdef NO_STRTOI64
/* This version only handles hex-strings without 0x prefix */

static __int64
_strtoi64(const char *spec, char **p, int base)
{
    __int64 result = 0;
    char c;
    while ((c = *spec)) {
	if ((c >= '0') && (c <= '9')) {