difforig Tk-804.028
2008-02-17 Reini Urban <rurban@x-ray.at>
* tkPort.h: cygwin does not define WIN32, only within pTk. So define it here.
* pTk/mTk/tclUnix/tclUnix{Event,Notfy,Time}.c:
They do not include tkUnixPort.h, so some declarations are missing under cygwin only.
* Tk/MMutil.pm: -limm32 and -lcomctl32 are missing
diff -ub Tk-804.028/Tk/MMutil.pm.orig
--- Tk-804.028/Tk/MMutil.pm.orig 2007-05-05 18:37:55.000000000 +0000
+++ Tk-804.028/Tk/MMutil.pm 2008-02-17 19:52:16.843750000 +0000
@@ -550,7 +550,7 @@
{
my $base = $Config{'libpth'};
$base =~ s#lib$#i386-mingw32/lib#;
- my $extra = "-L$base -lcomdlg32 -lgdi32";
+ my $extra = "-L$base -limm32 -lcomctl32 -lcomdlg32 -lgdi32";
my $libs = $att{'LIBS'}->[0];
$att{'LIBS'}->[0] = "$extra $libs";
}
@@ -562,7 +562,7 @@
push(@opt,'LD' => 'gcc -shared');
if ($win_arch eq 'MSWin32')
{
- my $extra = "-L/lib/w32api -lcomdlg32 -lgdi32";
+ my $extra = "-L/lib/w32api -limm32 -lcomctl32 -lcomdlg32 -lgdi32";
my $libs = $att{'LIBS'}->[0];
$att{'LIBS'}->[0] = "$extra $libs";
$att{'DEFINE'} .= ' -D__WIN32__ -D_WIN32 -DWINARCH_MSWIN32';
diff -ub Tk-804.028/pTk/mTk/tclUnix/tclUnixEvent.c.orig
--- Tk-804.028/pTk/mTk/tclUnix/tclUnixEvent.c.orig 2007-05-05 18:39:41.000000000 +0000
+++ Tk-804.028/pTk/mTk/tclUnix/tclUnixEvent.c 2008-02-17 19:29:54.031250000 +0000
@@ -20,6 +20,11 @@
#include "Lang.h"
#endif
#ifdef TCL_EVENT_IMPLEMENT
+
+#ifdef __CYGWIN__
+# include <sys/time.h>
+#endif
+
/*
*----------------------------------------------------------------------
*
diff -ub Tk-804.028/pTk/mTk/tclUnix/tclUnixNotfy.c.orig
--- Tk-804.028/pTk/mTk/tclUnix/tclUnixNotfy.c.orig 2007-05-05 18:39:37.000000000 +0000
+++ Tk-804.028/pTk/mTk/tclUnix/tclUnixNotfy.c 2008-02-17 19:41:04.156250000 +0000
@@ -35,6 +35,34 @@
#endif
extern Tcl_NotifierProcs tclOriginalNotifier;
+#ifndef MASK_SIZE
+/* under Cygwin we use tclUnix but tkWin.
+ So bring in some "tkUnixPort.h" definitions
+ */
+#ifdef HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
+
+/*
+ * The following macro defines the number of fd_masks in an fd_set:
+ */
+
+#ifndef FD_SETSIZE
+# ifdef OPEN_MAX
+# define FD_SETSIZE OPEN_MAX
+# else
+# define FD_SETSIZE 256
+# endif
+#endif
+#if !defined(howmany)
+# define howmany(x, y) (((x)+((y)-1))/(y))
+#endif
+#ifndef NFDBITS
+# define NFDBITS NBBY*sizeof(fd_mask)
+#endif
+#define MASK_SIZE howmany(FD_SETSIZE, NFDBITS)
+#endif
+
/*
* This structure is used to keep track of the notifier info for a
* a registered file.
diff -ub Tk-804.028/pTk/mTk/tclUnix/tclUnixTime.c.orig
--- Tk-804.028/pTk/mTk/tclUnix/tclUnixTime.c.orig 2007-05-05 18:39:34.000000000 +0000
+++ Tk-804.028/pTk/mTk/tclUnix/tclUnixTime.c 2008-02-17 19:25:56.562500000 +0000
@@ -15,11 +15,15 @@
#include "Lang.h"
#ifdef TCL_EVENT_IMPLEMENT
-
-#ifdef __EMX__
+#if TIME_WITH_SYS_TIME
# include <sys/time.h>
-#else
# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
#endif
#if 0
diff -ub Tk-804.028/pTk/tkPort.h.orig
--- Tk-804.028/pTk/tkPort.h.orig 2008-02-17 18:47:08.812500000 +0000
+++ Tk-804.028/pTk/tkPort.h 2008-02-17 18:49:27.281250000 +0000
@@ -24,6 +24,10 @@
#include "Lang.h"
#endif
+#if defined(__WIN32__) && !defined(WIN32)
+#define WIN32
+#endif
+
#if defined(__WIN32__) || defined(_WIN32)
# include "tkWinPort.h"
# ifndef strcasecmp
diff -ub Tk-804.028/tkGlue.h.orig
--- Tk-804.028/tkGlue.h.orig 2007-05-05 18:37:45.000000000 +0000
+++ Tk-804.028/tkGlue.h 2008-02-17 18:48:07.968750000 +0000
@@ -66,14 +66,14 @@
extern SV * sv_maybe_utf8(SV *sv);
extern SV * Lang_SystemEncoding(void);
+#ifdef WIN32
+#include "pTk/tkWinInt.h"
+#endif
+
#ifndef WIN32
#define HWND void *
#endif
EXTERN HWND SVtoHWND _ANSI_ARGS_((SV *win));
-#ifdef WIN32
-#include "pTk/tkWinInt.h"
-#endif
-
#endif