apply ncurses-5.9-20120107.patch
authorAnas Nashif <anas.nashif@intel.com>
Fri, 28 Dec 2012 01:23:00 +0000 (17:23 -0800)
committerAnas Nashif <anas.nashif@intel.com>
Fri, 28 Dec 2012 01:23:00 +0000 (17:23 -0800)
12 files changed:
MANIFEST
Makefile.in
NEWS
README.MinGW
aclocal.m4
configure
configure.in
dist.mk
ncurses/tinfo/db_iterator.c
progs/tset.c
test/README
test/rain.c

index 5a95a1c..5399b9a 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
 ./mk-0th.awk
 ./mk-1st.awk
 ./mk-2nd.awk
-./mk-dlls.sh.in
 ./mk-hdr.awk
 ./ncurses/Makefile.in
 ./ncurses/README
index b99d35e..35db743 100644 (file)
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.31 2011/08/07 15:36:52 tom Exp $
+# $Id: Makefile.in,v 1.32 2012/01/07 20:10:29 juergen Exp $
 ##############################################################################
-# Copyright (c) 1998-2008,2010 Free Software Foundation, Inc.                #
+# Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.                #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
@@ -88,12 +88,9 @@ preinstall :
                fgrep NCURSES_VERSION $(includedir)/curses.h >/dev/null || \
                echo '** Will overwrite non-ncurses curses.h'
 
-dlls:  libs
-       $(SHELL) $(srcdir)/mk-dlls.sh
-
 distclean \
 realclean ::
-       -rm -f mk-dlls.sh mingw_arch
+
 
 # Put the common rules here so that we can easily construct the list of
 # directories to visit.
diff --git a/NEWS b/NEWS
index 42eb742..dab32eb 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1838 2012/01/01 00:18:49 tom Exp $
+-- $Id: NEWS,v 1.1839 2012/01/07 20:48:35 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,14 @@ See the AUTHORS file for the corresponding full names.
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20120107
+       + various improvments for MinGW (patch by Juergen Pfeifer):
+         + modify stat() calls to ignore the st_size member
+         + drop mk-dlls.sh script.
+         + change recommended regular expression library.
+         + modify rain.c to allow for threaded configuraton.
+         + modify tset.c to allow for case when size-change logic is not used. 
+
 20111231
        + modify toe's report when -a and -s options are combined, to add
          a column showing which entries belong to a given database.
index d111b38..fd5b552 100644 (file)
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: README.MinGW,v 1.5 2011/02/26 16:57:17 tom Exp $
+-- $Id: README.MinGW,v 1.7 2012/01/07 21:26:05 tom Exp $
 -- Author: Juergen Pfeifer
 -------------------------------------------------------------------------------
 
@@ -39,7 +39,7 @@ from http://www.mingw.org
 To build ncurses for native Windows, you need the MinGW toolchain.  The
 original MinGW toolchain from the above site is only for 32-Bit Windows.  As
 Windows Server - and also regular workstations - are moving to 64-Bit, it
-seems to be reasonable to have a toolchain that supports both architectures. 
+seems to be reasonable to have a toolchain that supports both architectures.
 I recommend to use the TDM gcc toolchain which you can find at
 http://tdm-gcc.tdragon.net/download.  Go to the download section and select
 the bundle installer for tdm64 (MinGW-w64).  This installs a multilib version
@@ -47,7 +47,7 @@ of the gcc toolchain that can compile for native 32- and 64-Bit Windows
 versions.  It also comes with a working pthread implementation.
 
 The latest config and build scripts we use for MinGW have only been tested
-for the gcc-4.4 compiler toolchain (or better).
+for the gcc-4.6.1 compiler toolchain (or better).
 
 Using MinGW is a pragmatic decision, it's the easiest way to port this
 heavily UNIX based sourcebase to native Windows. The goal is of course
@@ -55,22 +55,12 @@ to provide the includes, libraries and DLLs to be used with the more
 common traditional development environments on Windows, mainly with
 Microsoft Visual Studio.
 
-If you start a bash from the MSYS environment, please make sure that the
-Microsoft Development tools are in your PATH right after the MinGW
-tools. The LIB.EXE tool is the only one needed. You need this only if 
-you want to build DLLs that work with native Windows programs. If you 
-don't have any Microsoft  Development tools on your machine, consider 
-at least to get the free "Visual C++ 2010 Express Edition". 
-It contains the LIB.EXE tool. You may also use this compiler to test 
-writing native Windows programs using the ncurses DLLs without using 
-MinGW then for writing apps.
-
 It is necessary to unset the TERM environment variable, to activate the
 Windows console-driver.
 
 Please also make sure that MSYS links to the correct directory containing
 your MinGW toolchain. For TDM this is usually C:\MinGW64. In your Windows
-CMD.EXE command shell go to the MSYS root directory (most probably 
+CMD.EXE command shell go to the MSYS root directory (most probably
 C:\MSYS or C:\MSYS\1.0) and verify, that there is a junction point mingw
 that points to the MinGW toolchain directory. If not, delete the mingw
 directory and use the mklink command (or the linkd.exe utility on older
@@ -79,58 +69,54 @@ Windows) to create the junction point.
 This code requires WindowsNT 5.1 or better, which means on the client
 Windows XP or better, on the server Windows Server 2003 or better.
 
-In order to build ncurses for the planned interop layer with .NET, we
-recommend to use these options with configure
+I recommend using libtool to build ncurses on MinGW, because libtool
+knows exactly how to build dll's on Windows for use with MinGW.
+
+To build a modern but still small footprint ncurses that provides
+hooks for interop, I recommend using these options:
 
+         --with-libtool
          --disable-home-terminfo
-         --enable-reentrant
+         --enable-database
+         --disable-termcap
          --enable-sp-funcs
          --enable-term-driver
          --enable-interop
-         --with-pthread         (if using TDM toolchain as recommended)
 
-This is the configuration commandline as I'm using it at the moment:
+This is the configuration commandline as I'm using it at the moment (assuming environment variable MINGW_ROOT to hold the root directory name of your MinGW build):
 
 ./configure \
-       --prefix=/mingw \
-       --without-cxx-binding \
+       --prefix=$MINGW_ROOT \
+       --with-cxx \
        --without-ada \
        --enable-warnings \
        --enable-assertions \
-       --enable-reentrant \
-       --with-debug \
-       --with-normal \
        --disable-home-terminfo \
+       --enable-database \
        --enable-sp-funcs \
        --enable-term-driver \
        --enable-interop \
-       --with-pthread
+       --disable-termcap \
+       --with-progs \
+       --with-libtool \
+       --enable-pc-files \
+       --mandir=$MINGW_ROOT/share/man
 
-If you are on a 64-Bit Windows system and want to build a 32-Bit version
-of ncurses, you may use this commandline for configuration (when using
-the TDM toolchain):
+Please note that it is also necessary to set this environment variable:
 
-CC="gcc -m32" LD="ld -m32" ./configure \
-       --prefix=/mingw \
-       --without-cxx-binding \
-       --without-ada \
-       --enable-warnings \
-       --enable-assertions \
-       --enable-reentrant \
-       --with-debug \
-       --with-normal \
-       --disable-home-terminfo \
-       --enable-sp-funcs \
-       --enable-term-driver \
-       --enable-interop \
-       --with-pthread
+export PATH_SEPARATOR=";"
 
-All the options above are - like the whole Windows support -
-experimental.
+in order to parse the terminfo paths correctly. Terminfo paths should
+always be separated by a seeeemicolon,even when running under MSYS.
 
-In order to build the DLLs, after your regular make you must call
+To support regular expressions properly, ncurses under MinGW should be
+linked against the gnurx regex library, which must be built separately
+under MinGW.  See
 
-   make dlls
+    ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/libgnurx-src-2.5.zip
+
+All the options above are - like the whole Windows support -
+experimental.
 
 A lot is still TODO, e.g.:
 
index b5bfb49..30bb1c5 100644 (file)
@@ -28,7 +28,7 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey 1995-on
 dnl
-dnl $Id: aclocal.m4,v 1.599 2012/01/01 01:55:05 tom Exp $
+dnl $Id: aclocal.m4,v 1.600 2012/01/07 20:08:24 juergen Exp $
 dnl Macros used in NCURSES auto-configuration script.
 dnl
 dnl These macros are maintained separately from NCURSES.  The copyright on
@@ -4984,7 +4984,7 @@ cf_regex_func=no
 cf_regex_libs="regex re"
 case $host_os in #(vi
 mingw*)
-       cf_regex_libs="regex.dll $cf_regex_libs"
+       cf_regex_libs="gnurx $cf_regex_libs"
        ;;
 esac
 
index 9ff7eb2..6299935 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.534 .
+# From configure.in Revision: 1.535 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by Autoconf 2.52.20101002.
 #
@@ -13745,7 +13745,7 @@ cf_regex_func=no
 cf_regex_libs="regex re"
 case $host_os in #(vi
 mingw*)
-       cf_regex_libs="regex.dll $cf_regex_libs"
+       cf_regex_libs="gnurx $cf_regex_libs"
        ;;
 esac
 
 ADAHTML_DIR=../../doc/html/ada
 
 SUB_SCRIPTS=
-case $cf_cv_system_name in #(vi
-*mingw32*) #(vi
-       SUB_SCRIPTS="mk-dlls.sh"
-       ;;
-esac
 
 ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/ncurses_dll.h include/termcap.h include/unctrl.h $SUB_SCRIPTS $SUB_MAKEFILES Makefile"
 ac_config_commands="$ac_config_commands default"
@@ -20491,7 +20486,7 @@ DEFS=-DHAVE_CONFIG_H
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:20494: creating $CONFIG_STATUS" >&5
+{ echo "$as_me:20489: creating $CONFIG_STATUS" >&5
 echo "$as_me: creating $CONFIG_STATUS" >&6;}
 cat >$CONFIG_STATUS <<_ACEOF
 #! $SHELL
@@ -20667,7 +20662,7 @@ cat >>$CONFIG_STATUS <<\EOF
     echo "$ac_cs_version"; exit 0 ;;
   --he | --h)
     # Conflict between --help and --header
-    { { echo "$as_me:20670: error: ambiguous option: $1
+    { { echo "$as_me:20665: error: ambiguous option: $1
 Try \`$0 --help' for more information." >&5
 echo "$as_me: error: ambiguous option: $1
 Try \`$0 --help' for more information." >&2;}
@@ -20686,7 +20681,7 @@ Try \`$0 --help' for more information." >&2;}
     ac_need_defaults=false;;
 
   # This is an error.
-  -*) { { echo "$as_me:20689: error: unrecognized option: $1
+  -*) { { echo "$as_me:20684: error: unrecognized option: $1
 Try \`$0 --help' for more information." >&5
 echo "$as_me: error: unrecognized option: $1
 Try \`$0 --help' for more information." >&2;}
@@ -20794,7 +20789,7 @@ do
   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
-  *) { { echo "$as_me:20797: error: invalid argument: $ac_config_target" >&5
+  *) { { echo "$as_me:20792: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   esac
@@ -21208,7 +21203,7 @@ done; }
   esac
 
   if test x"$ac_file" != x-; then
-    { echo "$as_me:21211: creating $ac_file" >&5
+    { echo "$as_me:21206: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
     rm -f "$ac_file"
   fi
@@ -21226,7 +21221,7 @@ echo "$as_me: creating $ac_file" >&6;}
       -) echo $tmp/stdin ;;
       [\\/$]*)
          # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:21229: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:21224: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -21239,7 +21234,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:21242: error: cannot find input file: $f" >&5
+           { { echo "$as_me:21237: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -21305,7 +21300,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
   * )   ac_file_in=$ac_file.in ;;
   esac
 
-  test x"$ac_file" != x- && { echo "$as_me:21308: creating $ac_file" >&5
+  test x"$ac_file" != x- && { echo "$as_me:21303: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
 
   # First look for the input files in the build tree, otherwise in the
@@ -21316,7 +21311,7 @@ echo "$as_me: creating $ac_file" >&6;}
       -) echo $tmp/stdin ;;
       [\\/$]*)
          # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:21319: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:21314: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -21329,7 +21324,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:21332: error: cannot find input file: $f" >&5
+           { { echo "$as_me:21327: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -21387,7 +21382,7 @@ cat >>$CONFIG_STATUS <<\EOF
   rm -f $tmp/in
   if test x"$ac_file" != x-; then
     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
-      { echo "$as_me:21390: $ac_file is unchanged" >&5
+      { echo "$as_me:21385: $ac_file is unchanged" >&5
 echo "$as_me: $ac_file is unchanged" >&6;}
     else
       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
index 04326ae..7b4866a 100644 (file)
@@ -28,14 +28,14 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey 1995-on
 dnl
-dnl $Id: configure.in,v 1.534 2011/12/17 21:12:37 tom Exp $
+dnl $Id: configure.in,v 1.535 2012/01/07 20:08:24 juergen Exp $
 dnl Process this file with autoconf to produce a configure script.
 dnl
 dnl See http://invisible-island.net/autoconf/ for additional information.
 dnl
 dnl ---------------------------------------------------------------------------
 AC_PREREQ(2.13.20020210)
-AC_REVISION($Revision: 1.534 $)
+AC_REVISION($Revision: 1.535 $)
 AC_INIT(ncurses/base/lib_initscr.c)
 AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
 
@@ -1875,11 +1875,6 @@ ADAHTML_DIR=../../doc/html/ada
 AC_SUBST(ADAHTML_DIR)
 
 SUB_SCRIPTS=
-case $cf_cv_system_name in #(vi
-*mingw32*) #(vi
-       SUB_SCRIPTS="mk-dlls.sh"
-       ;;
-esac
 
 AC_OUTPUT( \
        include/MKterm.h.awk \
diff --git a/dist.mk b/dist.mk
index ecbe6e8..911c297 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.850 2011/12/31 14:27:53 tom Exp $
+# $Id: dist.mk,v 1.851 2012/01/07 13:48:28 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -37,7 +37,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 5
 NCURSES_MINOR = 9
-NCURSES_PATCH = 20111231
+NCURSES_PATCH = 20120107
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 0cf6876..3a4827d 100644 (file)
@@ -43,7 +43,7 @@
 #include <hashed_db.h>
 #endif
 
-MODULE_ID("$Id: db_iterator.c,v 1.25 2011/12/17 21:30:20 tom Exp $")
+MODULE_ID("$Id: db_iterator.c,v 1.26 2012/01/07 20:09:36 juergen Exp $")
 
 #define HaveTicDirectory _nc_globals.have_tic_directory
 #define KeepTicDirectory _nc_globals.keep_tic_directory
@@ -60,7 +60,7 @@ add_to_blob(const char *text)
     if (*text != '\0') {
        char *last = my_blob + strlen(my_blob);
        if (last != my_blob)
-           *last++ = ':';
+           *last++ = NCURSES_PATHSEP;
        strcpy(last, text);
     }
 }
@@ -69,20 +69,26 @@ static bool
 check_existence(const char *name, struct stat *sb)
 {
     bool result = FALSE;
-
-    if (stat(name, sb) == 0 && sb->st_size) {
+    if (stat(name, sb) == 0
+#ifndef __MINGW32__
+       && sb->st_size
+#endif
+       ) {
        result = TRUE;
     }
 #if USE_HASHED_DB
     else if (strlen(name) < PATH_MAX - sizeof(DBM_SUFFIX)) {
        char temp[PATH_MAX];
        sprintf(temp, "%s%s", name, DBM_SUFFIX);
-       if (stat(temp, sb) == 0 && sb->st_size) {
+       if (stat(temp, sb) == 0
+#ifndef __MINGW32__
+           && sb->st_size
+#endif
+           ) {
            result = TRUE;
        }
     }
 #endif
-
     return result;
 }
 
@@ -280,6 +286,7 @@ _nc_first_db(DBDIRS * state, int *offset)
            values[dbdHome] = _nc_home_terminfo();
            (void) cache_getenv("HOME", dbdHome);
            values[dbdEnvList] = cache_getenv("TERMINFO_DIRS", dbdEnvList);
+
 #endif
 #if USE_TERMCAP
            values[dbdEnvOnce2] = cache_getenv("TERMCAP", dbdEnvOnce2);
@@ -310,7 +317,7 @@ _nc_first_db(DBDIRS * state, int *offset)
             */
            blobsize = 2;
            for (j = 0; my_blob[j] != '\0'; ++j) {
-               if (my_blob[j] == ':')
+               if (my_blob[j] == NCURSES_PATHSEP)
                    ++blobsize;
            }
            my_list = typeCalloc(char *, blobsize);
@@ -319,7 +326,7 @@ _nc_first_db(DBDIRS * state, int *offset)
                k = 0;
                my_list[k++] = my_blob;
                for (j = 0; my_blob[j] != '\0'; ++j) {
-                   if (my_blob[j] == ':') {
+                   if (my_blob[j] == NCURSES_PATHSEP) {
                        my_blob[j] = '\0';
                        my_list[k++] = &my_blob[j + 1];
                    }
index 1a963bc..7a5c5b8 100644 (file)
@@ -119,7 +119,7 @@ char *ttyname(int fd);
 #include <dump_entry.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tset.c,v 1.85 2011/12/10 15:41:34 tom Exp $")
+MODULE_ID("$Id: tset.c,v 1.86 2012/01/07 20:23:20 juergen Exp $")
 
 /*
  * SCO defines TIOCGSIZE and the corresponding struct.  Other systems (SunOS,
@@ -1050,11 +1050,18 @@ set_tabs(void)
 {
     if (set_tab && clear_all_tabs) {
        int c;
+       int lim =
+#if HAVE_SIZECHANGE
+       tcolumns
+#else
+       columns
+#endif
+        ;
 
        (void) putc('\r', stderr);      /* Force to left margin. */
        tputs(clear_all_tabs, 0, outc);
 
-       for (c = 8; c < tcolumns; c += 8) {
+       for (c = 8; c < lim; c += 8) {
            /* Get to the right column.  In BSD tset, this
             * used to try a bunch of half-clever things
             * with cup and hpa, for an average saving of
index 8a016ec..c6498df 100644 (file)
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: README,v 1.44 2011/02/26 00:09:25 tom Exp $
+-- $Id: README,v 1.45 2012/01/07 21:19:28 tom Exp $
 -------------------------------------------------------------------------------
 
 The programs in this directory are designed to test your newest toy :-)
@@ -234,7 +234,7 @@ addnstr                             test: test_addstr
 addnwstr                       test: ncurses test_addwstr
 addstr                         test: blue bs cardfile gdc hanoi lrtest ncurses savescreen test_addstr
 addwstr                                test: ncurses test_addwstr
-assume_default_colors          test: ncurses
+assume_default_colors          test: background ncurses
 assume_default_colors_sp       -
 attr_get                       test: ncurses
 attr_off                       test: ncurses
@@ -670,7 +670,7 @@ ungetch_sp                  lib: ncurses
 ungetmouse                     -
 ungetmouse_sp                  -
 untouchwin                     lib: form
-use_default_colors             test: filter firework gdc hanoi knight ncurses rain tclock worm xmas
+use_default_colors             test: background filter firework gdc hanoi knight ncurses rain tclock worm xmas
 use_default_colors_sp          -
 use_env                                progs: tput
 use_env_sp                     -
index 5f0cbfa..f8787a9 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: rain.c,v 1.38 2010/11/13 20:11:46 tom Exp $
+ * $Id: rain.c,v 1.39 2012/01/07 20:10:29 juergen Exp $
  */
 #include <test.priv.h>
 
@@ -222,7 +222,7 @@ draw_drop(void *arg)
      * Find myself in the list of threads so we can count the number of loops.
      */
     for (mystats = 0; mystats < MAX_THREADS; ++mystats) {
-#ifdef __MINGW32__
+#if defined(__MINGW32__) && !defined(__WINPTHREADS_VERSION)
        if (drop_threads[mystats].myself.p == pthread_self().p)
 #else
        if (drop_threads[mystats].myself == pthread_self())
@@ -256,7 +256,7 @@ draw_drop(void *arg)
 /*
  * The description of pthread_create() is misleading, since it implies that
  * threads will exit cleanly after their function returns.
- * 
+ *
  * Since they do not (and the number of threads is limited by system
  * resources), make a limited number of threads, and signal any that are
  * waiting when we want a thread past that limit.