diff options
author | nijtmans <nijtmans> | 2010-01-22 14:17:53 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-01-22 14:17:53 (GMT) |
commit | 3998cf77ee9513d59f553516618187a6bccb697f (patch) | |
tree | 000910596afd8ed4fc7d62d3df7ec8d8b277d252 /win | |
parent | 027efdef074cb8c116b5f9c888ad445ea692f654 (diff) | |
download | tk-3998cf77ee9513d59f553516618187a6bccb697f.zip tk-3998cf77ee9513d59f553516618187a6bccb697f.tar.gz tk-3998cf77ee9513d59f553516618187a6bccb697f.tar.bz2 |
fix more gcc warnings: missing initializer
Eliminate use of __argc and __argv for CYGWIN
Make cygwin configuration error into
a warning: CYGWIN compilation works
although there still are test failures.
Diffstat (limited to 'win')
-rwxr-xr-x | win/configure | 177 | ||||
-rw-r--r-- | win/configure.in | 71 | ||||
-rw-r--r-- | win/tcl.m4 | 16 | ||||
-rw-r--r-- | win/tkWinMenu.c | 4 | ||||
-rw-r--r-- | win/tkWinPort.h | 28 | ||||
-rw-r--r-- | win/tkWinSend.c | 6 | ||||
-rw-r--r-- | win/tkWinSendCom.c | 6 | ||||
-rw-r--r-- | win/tkWinTest.c | 5 | ||||
-rw-r--r-- | win/ttkWinTheme.c | 16 | ||||
-rw-r--r-- | win/winMain.c | 138 |
10 files changed, 308 insertions, 159 deletions
diff --git a/win/configure b/win/configure index afa8c91..3174022 100755 --- a/win/configure +++ b/win/configure @@ -309,7 +309,7 @@ ac_includes_default="\ # include <unistd.h> #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP AR RANLIB RC SET_MAKE TCL_THREADS CYGPATH CELIB_DIR DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING MAN2TCLFLAGS CFLAGS_DEFAULT LDFLAGS_DEFAULT TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_DEFS BUILD_TCLSH TCLSH_PROG TK_WIN_VERSION MACHINE TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_DBGX TK_LIB_FILE TK_DLL_FILE TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_BUILD_STUB_LIB_SPEC TK_SRC_DIR TK_BIN_DIR TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL TCL_DBGX CFG_TK_SHARED_LIB_SUFFIX CFG_TK_UNSHARED_LIB_SUFFIX CFG_TK_EXPORT_FILE_SUFFIX TK_SHARED_BUILD DEPARG EXTRA_CFLAGS STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX CC_OBJNAME CC_EXENAME LDFLAGS_DEBUG LDFLAGS_OPTIMIZE LDFLAGS_CONSOLE LDFLAGS_WINDOW RC_OUT RC_TYPE RC_INCLUDE RC_DEFINE RC_DEFINES TK_RES RES LIBS_GUI DLLSUFFIX LIBPREFIX LIBSUFFIX EXESUFFIX LIBRARIES MAKE_LIB POST_MAKE_LIB MAKE_DLL MAKE_EXE TK_LIB_FLAG TK_LIB_SPEC TK_BUILD_LIB_SPEC TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_BUILD_STUB_LIB_PATH TK_CC_SEARCH_FLAGS TK_LD_SEARCH_FLAGS LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP AR RANLIB RC SET_MAKE TCL_THREADS CYGPATH CELIB_DIR DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING MAN2TCLFLAGS CFLAGS_DEFAULT LDFLAGS_DEFAULT TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_DEFS BUILD_TCLSH TCLSH_PROG TK_WIN_VERSION MACHINE TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_DBGX TK_LIB_FILE TK_DLL_FILE TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_BUILD_STUB_LIB_SPEC TK_SRC_DIR TK_BIN_DIR TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL TCL_DBGX CFG_TK_SHARED_LIB_SUFFIX CFG_TK_UNSHARED_LIB_SUFFIX CFG_TK_EXPORT_FILE_SUFFIX EXTRA_CFLAGS DEPARG CC_OBJNAME CC_EXENAME LDFLAGS_DEBUG LDFLAGS_OPTIMIZE LDFLAGS_CONSOLE LDFLAGS_WINDOW TK_RES STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX TK_SHARED_BUILD LIBS_GUI DLLSUFFIX LIBPREFIX LIBSUFFIX EXESUFFIX LIBRARIES MAKE_LIB POST_MAKE_LIB MAKE_DLL MAKE_EXE TK_LIB_FLAG TK_LIB_SPEC TK_BUILD_LIB_SPEC TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_BUILD_STUB_LIB_PATH TK_CC_SEARCH_FLAGS TK_LD_SEARCH_FLAGS RC_OUT RC_TYPE RC_INCLUDE RC_DEFINE RC_DEFINES RES LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -1322,7 +1322,7 @@ fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi -# libdir must be a fully qualified path and (not ${exec_prefix}/lib) +# libdir must be a fully qualified path (not ${exec_prefix}/lib) eval libdir="$libdir" #------------------------------------------------------------------------ @@ -2886,7 +2886,7 @@ echo "$as_me: error: Required resource tool 'windres' not found on PATH." >&2;} fi #-------------------------------------------------------------------- -# Checks to see if the make progeam sets the $MAKE variable. +# Checks to see if the make progam sets the $MAKE variable. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 @@ -2924,74 +2924,6 @@ fi #-------------------------------------------------------------------- -echo "$as_me:$LINENO: checking for Cygwin version of gcc" >&5 -echo $ECHO_N "checking for Cygwin version of gcc... $ECHO_C" >&6 -if test "${ac_cv_cygwin+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#ifdef __CYGWIN__ -#error cygwin -#endif - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_cygwin=no -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_cygwin=yes -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:$LINENO: result: $ac_cv_cygwin" >&5 -echo "${ECHO_T}$ac_cv_cygwin" >&6 -if test "$ac_cv_cygwin" = "yes" ; then - { { echo "$as_me:$LINENO: error: Compiling under Cygwin is not currently supported. -A maintainer for the Cygwin port of Tcl/Tk is needed. See the README -file for information about building with Mingw." >&5 -echo "$as_me: error: Compiling under Cygwin is not currently supported. -A maintainer for the Cygwin port of Tcl/Tk is needed. See the README -file for information about building with Mingw." >&2;} - { (exit 1); exit 1; }; } -fi - #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- @@ -3270,6 +3202,72 @@ echo "${ECHO_T}yes" >&6 cyg_conftest= fi + echo "$as_me:$LINENO: checking for Cygwin version of gcc" >&5 +echo $ECHO_N "checking for Cygwin version of gcc... $ECHO_C" >&6 +if test "${ac_cv_cygwin+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #ifdef __CYGWIN__ + #error cygwin + #endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_cygwin=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_cygwin=yes +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $ac_cv_cygwin" >&5 +echo "${ECHO_T}$ac_cv_cygwin" >&6 + if test "$ac_cv_cygwin" = "yes" ; then + { echo "$as_me:$LINENO: WARNING: Compiling under Cygwin is not currently supported. +If you are not sure you want this, see the README +file for information about building with Mingw." >&5 +echo "$as_me: WARNING: Compiling under Cygwin is not currently supported. +If you are not sure you want this, see the README +file for information about building with Mingw." >&2;} + fi if test "$CYGPATH" = "echo" || test "$ac_cv_cygwin" = "yes"; then DEPARG='"$<"' else @@ -4236,7 +4234,7 @@ CFG_TK_EXPORT_FILE_SUFFIX=${TK_EXPORT_FILE_SUFFIX} # on symbols and static vs. shared. #-------------------------------------------------------------------- -if test "$SHARED_BUILD" = 0 -o "$TCL_NEEDS_EXP_FILE" = 0; then +if test ${SHARED_BUILD} = 0 -o "$TCL_NEEDS_EXP_FILE" = 0; then if test "${DBGX}" = "d"; then RC_DEFINES="${RC_DEFINE} STATIC_BUILD ${RC_DEFINE} DEBUG" else @@ -4297,6 +4295,7 @@ TK_WIN_VERSION="$TK_VERSION.$TK_RELEASE_LEVEL.`echo $TK_PATCH_LEVEL | tr -d ab.` +# win/tcl.m4 doesn't set (LDFLAGS) @@ -4332,10 +4331,15 @@ TK_WIN_VERSION="$TK_VERSION.$TK_RELEASE_LEVEL.`echo $TK_PATCH_LEVEL | tr -d ab.` +# undefined at this point for win + + + + + -# undefined at this point for win @@ -5032,27 +5036,21 @@ s,@TCL_DBGX@,$TCL_DBGX,;t t s,@CFG_TK_SHARED_LIB_SUFFIX@,$CFG_TK_SHARED_LIB_SUFFIX,;t t s,@CFG_TK_UNSHARED_LIB_SUFFIX@,$CFG_TK_UNSHARED_LIB_SUFFIX,;t t s,@CFG_TK_EXPORT_FILE_SUFFIX@,$CFG_TK_EXPORT_FILE_SUFFIX,;t t -s,@TK_SHARED_BUILD@,$TK_SHARED_BUILD,;t t -s,@DEPARG@,$DEPARG,;t t s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t -s,@STLIB_LD@,$STLIB_LD,;t t -s,@SHLIB_LD@,$SHLIB_LD,;t t -s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t -s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t -s,@SHLIB_SUFFIX@,$SHLIB_SUFFIX,;t t +s,@DEPARG@,$DEPARG,;t t s,@CC_OBJNAME@,$CC_OBJNAME,;t t s,@CC_EXENAME@,$CC_EXENAME,;t t s,@LDFLAGS_DEBUG@,$LDFLAGS_DEBUG,;t t s,@LDFLAGS_OPTIMIZE@,$LDFLAGS_OPTIMIZE,;t t s,@LDFLAGS_CONSOLE@,$LDFLAGS_CONSOLE,;t t s,@LDFLAGS_WINDOW@,$LDFLAGS_WINDOW,;t t -s,@RC_OUT@,$RC_OUT,;t t -s,@RC_TYPE@,$RC_TYPE,;t t -s,@RC_INCLUDE@,$RC_INCLUDE,;t t -s,@RC_DEFINE@,$RC_DEFINE,;t t -s,@RC_DEFINES@,$RC_DEFINES,;t t s,@TK_RES@,$TK_RES,;t t -s,@RES@,$RES,;t t +s,@STLIB_LD@,$STLIB_LD,;t t +s,@SHLIB_LD@,$SHLIB_LD,;t t +s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t +s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t +s,@SHLIB_SUFFIX@,$SHLIB_SUFFIX,;t t +s,@TK_SHARED_BUILD@,$TK_SHARED_BUILD,;t t s,@LIBS_GUI@,$LIBS_GUI,;t t s,@DLLSUFFIX@,$DLLSUFFIX,;t t s,@LIBPREFIX@,$LIBPREFIX,;t t @@ -5071,6 +5069,12 @@ s,@TK_STUB_LIB_PATH@,$TK_STUB_LIB_PATH,;t t s,@TK_BUILD_STUB_LIB_PATH@,$TK_BUILD_STUB_LIB_PATH,;t t s,@TK_CC_SEARCH_FLAGS@,$TK_CC_SEARCH_FLAGS,;t t s,@TK_LD_SEARCH_FLAGS@,$TK_LD_SEARCH_FLAGS,;t t +s,@RC_OUT@,$RC_OUT,;t t +s,@RC_TYPE@,$RC_TYPE,;t t +s,@RC_INCLUDE@,$RC_INCLUDE,;t t +s,@RC_DEFINE@,$RC_DEFINE,;t t +s,@RC_DEFINES@,$RC_DEFINES,;t t +s,@RES@,$RES,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF @@ -5336,3 +5340,4 @@ if test "$no_create" != yes; then $ac_cs_success || { (exit 1); exit 1; } fi + diff --git a/win/configure.in b/win/configure.in index f29e05e..31c653f 100644 --- a/win/configure.in +++ b/win/configure.in @@ -3,7 +3,7 @@ # generate the file "configure", which is run during Tk installation # to configure the system for the local environment. # -# RCS: @(#) $Id: configure.in,v 1.87 2009/08/09 21:20:34 nijtmans Exp $ +# RCS: @(#) $Id: configure.in,v 1.88 2010/01/22 14:17:53 nijtmans Exp $ AC_INIT(../generic/tk.h) AC_PREREQ(2.59) @@ -29,7 +29,7 @@ fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi -# libdir must be a fully qualified path and (not ${exec_prefix}/lib) +# libdir must be a fully qualified path (not ${exec_prefix}/lib) eval libdir="$libdir" #------------------------------------------------------------------------ @@ -73,7 +73,7 @@ if test "${GCC}" = "yes" ; then fi #-------------------------------------------------------------------- -# Checks to see if the make progeam sets the $MAKE variable. +# Checks to see if the make progam sets the $MAKE variable. #-------------------------------------------------------------------- AC_PROG_MAKE_SET @@ -87,23 +87,6 @@ dnl under autoconf 2.5X. dnl dnl AC_CYGWIN -AC_CACHE_CHECK(for Cygwin version of gcc, - ac_cv_cygwin, -AC_TRY_COMPILE([ -#ifdef __CYGWIN__ -#error cygwin -#endif -], -[], - ac_cv_cygwin=no, - ac_cv_cygwin=yes) -) -if test "$ac_cv_cygwin" = "yes" ; then - AC_MSG_ERROR([Compiling under Cygwin is not currently supported. -A maintainer for the Cygwin port of Tcl/Tk is needed. See the README -file for information about building with Mingw.]) -fi - #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- @@ -125,7 +108,7 @@ SC_ENABLE_THREADS SC_ENABLE_SHARED #-------------------------------------------------------------------- -# The statements below define a collection of compile flags. This +# The statements below define a collection of compile flags. This # macro depends on the value of SHARED_BUILD, and should be called # after SC_ENABLE_SHARED checks the configure switches. #-------------------------------------------------------------------- @@ -151,7 +134,7 @@ AC_CHECK_HEADER([vssym32.h], [AC_DEFINE(HAVE_VSSYM32_H)], [], #include <uxtheme.h>]) #-------------------------------------------------------------------- -# Set the default compiler switches based on the --enable-symbols +# 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. #-------------------------------------------------------------------- @@ -218,7 +201,7 @@ CFG_TK_EXPORT_FILE_SUFFIX=${TK_EXPORT_FILE_SUFFIX} # on symbols and static vs. shared. #-------------------------------------------------------------------- -if test "$SHARED_BUILD" = 0 -o "$TCL_NEEDS_EXP_FILE" = 0; then +if test ${SHARED_BUILD} = 0 -o "$TCL_NEEDS_EXP_FILE" = 0; then if test "${DBGX}" = "d"; then RC_DEFINES="${RC_DEFINE} STATIC_BUILD ${RC_DEFINE} DEBUG" else @@ -264,25 +247,22 @@ AC_SUBST(TCL_VERSION) AC_SUBST(TCL_MAJOR_VERSION) AC_SUBST(TCL_MINOR_VERSION) AC_SUBST(TCL_PATCH_LEVEL) + AC_SUBST(TCL_SRC_DIR) AC_SUBST(TCL_BIN_DIR) AC_SUBST(TCL_DBGX) AC_SUBST(CFG_TK_SHARED_LIB_SUFFIX) AC_SUBST(CFG_TK_UNSHARED_LIB_SUFFIX) AC_SUBST(CFG_TK_EXPORT_FILE_SUFFIX) -AC_SUBST(TK_SHARED_BUILD) -AC_SUBST(CYGPATH) -AC_SUBST(DEPARG) AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(EXTRA_CFLAGS) -AC_SUBST(STLIB_LD) -AC_SUBST(SHLIB_LD) -AC_SUBST(SHLIB_LD_LIBS) -AC_SUBST(SHLIB_CFLAGS) -AC_SUBST(SHLIB_SUFFIX) +AC_SUBST(CYGPATH) +AC_SUBST(DEPARG) AC_SUBST(CC_OBJNAME) AC_SUBST(CC_EXENAME) + +# win/tcl.m4 doesn't set (LDFLAGS) AC_SUBST(LDFLAGS_DEFAULT) AC_SUBST(LDFLAGS_DEBUG) AC_SUBST(LDFLAGS_OPTIMIZE) @@ -290,14 +270,15 @@ AC_SUBST(LDFLAGS_CONSOLE) AC_SUBST(LDFLAGS_WINDOW) AC_SUBST(AR) AC_SUBST(RANLIB) -AC_SUBST(RC) -AC_SUBST(RC_OUT) -AC_SUBST(RC_TYPE) -AC_SUBST(RC_INCLUDE) -AC_SUBST(RC_DEFINE) -AC_SUBST(RC_DEFINES) AC_SUBST(TK_RES) -AC_SUBST(RES) + +AC_SUBST(STLIB_LD) +AC_SUBST(SHLIB_LD) +AC_SUBST(SHLIB_LD_LIBS) +AC_SUBST(SHLIB_CFLAGS) +AC_SUBST(SHLIB_SUFFIX) +AC_SUBST(TK_SHARED_BUILD) + AC_SUBST(LIBS) AC_SUBST(LIBS_GUI) AC_SUBST(DLLSUFFIX) @@ -321,4 +302,16 @@ AC_SUBST(TK_BUILD_STUB_LIB_PATH) AC_SUBST(TK_CC_SEARCH_FLAGS) AC_SUBST(TK_LD_SEARCH_FLAGS) -AC_OUTPUT([Makefile tkConfig.sh wish.exe.manifest]) +AC_SUBST(RC) +AC_SUBST(RC_OUT) +AC_SUBST(RC_TYPE) +AC_SUBST(RC_INCLUDE) +AC_SUBST(RC_DEFINE) +AC_SUBST(RC_DEFINES) +AC_SUBST(RES) + +AC_OUTPUT(Makefile tkConfig.sh wish.exe.manifest) + +dnl Local Variables: +dnl mode: autoconf; +dnl End: @@ -432,6 +432,22 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ cyg_conftest= fi + AC_CACHE_CHECK(for Cygwin version of gcc, + ac_cv_cygwin, + AC_TRY_COMPILE([ + #ifdef __CYGWIN__ + #error cygwin + #endif + ], + [], + ac_cv_cygwin=no, + ac_cv_cygwin=yes) + ) + if test "$ac_cv_cygwin" = "yes" ; then + AC_MSG_WARN([Compiling under Cygwin is not currently supported. +If you are not sure you want this, see the README +file for information about building with Mingw.]) + fi if test "$CYGPATH" = "echo" || test "$ac_cv_cygwin" = "yes"; then DEPARG='"$<"' else diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 4426546..8beac62 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinMenu.c,v 1.71 2010/01/03 19:50:59 patthoyts Exp $ + * RCS: @(#) $Id: tkWinMenu.c,v 1.72 2010/01/22 14:17:53 nijtmans Exp $ */ #define WINVER 0x0500 /* Requires Windows 2K definitions */ @@ -19,8 +19,6 @@ #include "tkWinInt.h" #include "tkMenu.h" -#include <string.h> - /* * The class of the window for popup menus. */ diff --git a/win/tkWinPort.h b/win/tkWinPort.h index 8069f46..3a99c43 100644 --- a/win/tkWinPort.h +++ b/win/tkWinPort.h @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinPort.h,v 1.12 2008/08/28 18:13:36 dgp Exp $ + * RCS: @(#) $Id: tkWinPort.h,v 1.13 2010/01/22 14:17:53 nijtmans Exp $ */ #ifndef _WINPORT @@ -30,7 +30,12 @@ #include <string.h> #include <limits.h> #include <fcntl.h> -#include <io.h> +#ifdef __CYGWIN__ +# include <unistd.h> +# include <wchar.h> +#else +# include <io.h> +#endif /* * Need to block out this include for building extensions with MetroWerks @@ -52,7 +57,15 @@ # define hypot _hypot #endif /* _MSC_VER */ -#ifndef __GNUC__ +#ifdef __CYGWIN__ +# ifdef _UNICODE +# define _tcsrchr wcsrchr +# else +# define _tcsrchr strrchr + +# endif +#else +# define wcscasecmp _wcsicmp # define strncasecmp strnicmp # define strcasecmp stricmp #endif @@ -117,13 +130,4 @@ #define TkpCreateNativeBitmap(display, source) None #define TkpGetNativeAppBitmap(display, name, w, h) None -/* - * Define timezone for gettimeofday. - */ - -struct timezone { - int tz_minuteswest; - int tz_dsttime; -}; - #endif /* _WINPORT */ diff --git a/win/tkWinSend.c b/win/tkWinSend.c index a6951af..addcad6 100644 --- a/win/tkWinSend.c +++ b/win/tkWinSend.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinSend.c,v 1.21 2010/01/13 23:08:11 nijtmans Exp $ + * RCS: @(#) $Id: tkWinSend.c,v 1.22 2010/01/22 14:17:53 nijtmans Exp $ */ #include "tkInt.h" @@ -843,7 +843,7 @@ Win32ErrorObj( if (lpBuffer == NULL) { lpBuffer = sBuffer; - wsprintf(sBuffer, _T("Error Code: %08lX"), hrError); + wsprintf(sBuffer, (const char *)_T("Error Code: %08lX"), hrError); } if ((p = _tcsrchr(lpBuffer, _T('\r'))) != NULL) { @@ -1034,7 +1034,7 @@ SendTrace( static char buffer[1024]; va_start(args, format); - _vsnprintf(buffer, 1023, format, args); + vsnprintf(buffer, 1023, format, args); OutputDebugString(buffer); va_end(args); } diff --git a/win/tkWinSendCom.c b/win/tkWinSendCom.c index f07259e..f3de005 100644 --- a/win/tkWinSendCom.c +++ b/win/tkWinSendCom.c @@ -18,7 +18,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinSendCom.c,v 1.9 2008/10/05 18:22:22 dkf Exp $ + * RCS: @(#) $Id: tkWinSendCom.c,v 1.10 2010/01/22 14:17:53 nijtmans Exp $ */ #include "tkInt.h" @@ -252,9 +252,9 @@ WinSendCom_GetIDsOfNames( if (rgDispId) { hr = DISP_E_UNKNOWNNAME; - if (_wcsicmp(*rgszNames, L"Send") == 0) { + if (wcscasecmp(*rgszNames, L"Send") == 0) { *rgDispId = TKWINSENDCOM_DISPID_SEND, hr = S_OK; - } else if (_wcsicmp(*rgszNames, L"Async") == 0) { + } else if (wcscasecmp(*rgszNames, L"Async") == 0) { *rgDispId = TKWINSENDCOM_DISPID_ASYNC, hr = S_OK; } } diff --git a/win/tkWinTest.c b/win/tkWinTest.c index d44bf38..b71fefa 100644 --- a/win/tkWinTest.c +++ b/win/tkWinTest.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinTest.c,v 1.29 2010/01/13 23:08:11 nijtmans Exp $ + * RCS: @(#) $Id: tkWinTest.c,v 1.30 2010/01/22 14:17:53 nijtmans Exp $ */ #ifndef USE_TCL_STUBS @@ -366,9 +366,6 @@ TestwineventCmd( } } message = TkFindStateNum(NULL, NULL, messageMap, argv[3]); - if (message < 0) { - message = strtol(argv[3], NULL, 0); - } wParam = 0; lParam = 0; diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c index e224f57..022fb62 100644 --- a/win/ttkWinTheme.c +++ b/win/ttkWinTheme.c @@ -1,6 +1,6 @@ /* winTheme.c - Copyright (C) 2004 Pat Thoyts <patthoyts@users.sf.net> * - * $Id: ttkWinTheme.c,v 1.14 2008/11/01 15:34:24 patthoyts Exp $ + * $Id: ttkWinTheme.c,v 1.15 2010/01/22 14:17:53 nijtmans Exp $ */ #ifdef _MSC_VER @@ -109,7 +109,7 @@ typedef struct { #define FIXEDSIZE(id) (id|_FIXEDSIZE) #define HALFMETRIC(id) (id|_HALFMETRIC) #define GETMETRIC(m) \ - ((m) & _FIXEDSIZE ? (m) & ~_FIXEDSIZE : GetSystemMetrics((m)&0x0fffffff)) + ((m) & _FIXEDSIZE ? (int)((m) & ~_FIXEDSIZE) : GetSystemMetrics((m)&0x0fffffff)) static FrameControlElementData FrameControlElements[] = { { "Checkbutton.indicator", @@ -191,7 +191,7 @@ typedef struct { static Ttk_ElementOptionSpec BorderElementOptions[] = { { "-relief",TK_OPTION_RELIEF,Tk_Offset(BorderElement,reliefObj), "flat" }, - {NULL} + {NULL, 0, 0, NULL} }; static void BorderElementSize( @@ -242,7 +242,7 @@ typedef struct { static Ttk_ElementOptionSpec FieldElementOptions[] = { { "-fieldbackground", TK_OPTION_BORDER, Tk_Offset(FieldElement,backgroundObj), "white" }, - {NULL} + { NULL, 0, 0, NULL } }; static void FieldElementSize( @@ -297,7 +297,7 @@ static Ttk_ElementOptionSpec ButtonBorderElementOptions[] = { Tk_Offset(ButtonBorderElement,highlightColorObj), "black" }, { "-default", TK_OPTION_ANY, Tk_Offset(ButtonBorderElement,defaultStateObj), "disabled" }, - {NULL} + {NULL, 0, 0, NULL} }; static void ButtonBorderElementSize( @@ -421,7 +421,7 @@ typedef struct { static Ttk_ElementOptionSpec FillFocusElementOptions[] = { { "-focusfill", TK_OPTION_COLOR, Tk_Offset(FillFocusElement,fillColorObj), "white" }, - { NULL } + {NULL, 0, 0, NULL} }; /* @@@ FIX THIS */ @@ -545,7 +545,7 @@ typedef struct { static Ttk_ElementOptionSpec ThumbElementOptions[] = { { "-orient", TK_OPTION_ANY,Tk_Offset(ThumbElement,orientObj),"horizontal"}, - { NULL } + { NULL, 0, 0, NULL } }; static void ThumbElementSize( @@ -602,7 +602,7 @@ typedef struct { static Ttk_ElementOptionSpec SliderElementOptions[] = { { "-orient", TK_OPTION_ANY, Tk_Offset(SliderElement,orientObj), "horizontal" }, - { NULL } + { NULL, 0, 0, NULL } }; static void SliderElementSize( diff --git a/win/winMain.c b/win/winMain.c index 5b914b1..b42e05e 100644 --- a/win/winMain.c +++ b/win/winMain.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: winMain.c,v 1.28 2009/10/21 20:28:52 nijtmans Exp $ + * RCS: @(#) $Id: winMain.c,v 1.29 2010/01/22 14:17:53 nijtmans Exp $ */ /* Make sure this file is never compiled with Stubs! */ @@ -36,6 +36,10 @@ static void WishPanic(const char *format, ...); extern int Tktest_Init(Tcl_Interp *interp); #endif /* TK_TEST */ +#if defined(__CYGWIN__) +static void setargv(int *argcPtr, char ***argvPtr); +#endif /* __CYGWIN__ */ + static BOOL consoleRequired = TRUE; /* @@ -107,8 +111,12 @@ WinMain( * Get our args from the c-runtime. Ignore lpszCmdLine. */ +#if defined(__CYGWIN__) + setargv(&argc, &argv); +#else argc = __argc; argv = __argv; +#endif /* * Forward slashes substituted for backslashes. @@ -287,6 +295,134 @@ main( return 0; } #endif /* !__GNUC__ || TK_TEST */ + + +/* + *------------------------------------------------------------------------- + * + * setargv -- + * + * Parse the Windows command line string into argc/argv. Done here + * because we don't trust the builtin argument parser in crt0. Windows + * applications are responsible for breaking their command line into + * arguments. + * + * 2N backslashes + quote -> N backslashes + begin quoted string + * 2N + 1 backslashes + quote -> literal + * N backslashes + non-quote -> literal + * quote + quote in a quoted string -> single quote + * quote + quote not in quoted string -> empty string + * quote -> begin quoted string + * + * Results: + * Fills argcPtr with the number of arguments and argvPtr with the array + * of arguments. + * + * Side effects: + * Memory allocated. + * + *-------------------------------------------------------------------------- + */ + +#if defined(__CYGWIN__) +static void +setargv( + int *argcPtr, /* Filled with number of argument strings. */ + char ***argvPtr) /* Filled with argument strings (malloc'd). */ +{ + char *cmdLine, *p, *arg, *argSpace; + char **argv; + int argc, size, inquote, copy, slashes; + + cmdLine = GetCommandLine(); /* INTL: BUG */ + + /* + * Precompute an overly pessimistic guess at the number of arguments in + * the command line by counting non-space spans. + */ + + size = 2; + for (p = cmdLine; *p != '\0'; p++) { + if ((*p == ' ') || (*p == '\t')) { /* INTL: ISO space. */ + size++; + while ((*p == ' ') || (*p == '\t')) { /* INTL: ISO space. */ + p++; + } + if (*p == '\0') { + break; + } + } + } + argSpace = (char *) ckalloc( + (unsigned) (size * sizeof(char *) + strlen(cmdLine) + 1)); + argv = (char **) argSpace; + argSpace += size * sizeof(char *); + size--; + + p = cmdLine; + for (argc = 0; argc < size; argc++) { + argv[argc] = arg = argSpace; + while ((*p == ' ') || (*p == '\t')) { /* INTL: ISO space. */ + p++; + } + if (*p == '\0') { + break; + } + + inquote = 0; + slashes = 0; + while (1) { + copy = 1; + while (*p == '\\') { + slashes++; + p++; + } + if (*p == '"') { + if ((slashes & 1) == 0) { + copy = 0; + if ((inquote) && (p[1] == '"')) { + p++; + copy = 1; + } else { + inquote = !inquote; + } + } + slashes >>= 1; + } + + while (slashes) { + *arg = '\\'; + arg++; + slashes--; + } + + if ((*p == '\0') || (!inquote && + ((*p == ' ') || (*p == '\t')))) { /* INTL: ISO space. */ + break; + } + if (copy != 0) { + *arg = *p; + arg++; + } + p++; + } + *arg = '\0'; + argSpace = arg + 1; + } + argv[argc] = NULL; + + *argcPtr = argc; + *argvPtr = argv; +} +#endif /* __CYGWIN__ */ + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ /* * Local Variables: |