From afb7489128719ac8999b037d49a0c28636d59558 Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Wed, 3 Mar 1999 17:11:14 +0000
Subject: [PATCH] wxUsleep() introduced (and documented) to try to work around
 usleep() bug in MT programs under Solaris

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1852 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 configure                  | 458 +++++++++++++++++++++----------------
 configure.in               |   5 +-
 docs/latex/wx/function.tex |  12 +
 include/wx/utils.h         |  29 ++-
 setup/setup.hin            |  12 +
 src/common/object.cpp      | 248 ++++++++++----------
 src/gtk/app.cpp            |  44 ++--
 src/gtk/threadpsx.cpp      |   4 +-
 src/gtk/utilsgtk.cpp       |  52 ++++-
 src/gtk1/app.cpp           |  44 ++--
 src/gtk1/threadpsx.cpp     |   4 +-
 src/gtk1/utilsgtk.cpp      |  52 ++++-
 src/motif/app.cpp          | 181 ++++++++-------
 src/msw/utils.cpp          |   5 +
 14 files changed, 645 insertions(+), 505 deletions(-)

diff --git a/configure b/configure
index 77c7c0ed0a..19202e45fb 100755
--- a/configure
+++ b/configure
@@ -2923,56 +2923,116 @@ fi
 
 fi
 
-echo $ac_n "checking for vsnprintf""... $ac_c" 1>&6
-echo "configure:2928: checking for vsnprintf" >&5
-if eval "test \"`echo '$''{'ac_cv_func_vsnprintf'+set}'`\" = set"; then
+for ac_func in vsnprintf
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2930: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2933 "configure"
+#line 2935 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char vsnprintf(); below.  */
+    which can conflict with char $ac_func(); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char vsnprintf();
+char $ac_func();
 
 int main() {
 
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_vsnprintf) || defined (__stub___vsnprintf)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-vsnprintf();
+$ac_func();
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:2956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
-  eval "ac_cv_func_vsnprintf=yes"
+  eval "ac_cv_func_$ac_func=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_vsnprintf=no"
+  eval "ac_cv_func_$ac_func=no"
 fi
 rm -f conftest*
 fi
 
-if eval "test \"`echo '$ac_cv_func_'vsnprintf`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
-#define HAVE_VSNPRINTF 1
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
 EOF
+ 
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
 
+for ac_func in nanosleep usleep
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2986: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2991 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+ 
 else
   echo "$ac_t""no" 1>&6
 fi
+done
 
 
 
@@ -2987,17 +3047,17 @@ for ac_hdr in iostream
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2991: checking for $ac_hdr" >&5
+echo "configure:3051: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2996 "configure"
+#line 3056 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3001: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3061: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3038,12 +3098,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:3042: checking for uid_t in sys/types.h" >&5
+echo "configure:3102: checking for uid_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3047 "configure"
+#line 3107 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -3072,7 +3132,7 @@ EOF
 fi
 
 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:3076: checking type of array argument to getgroups" >&5
+echo "configure:3136: checking type of array argument to getgroups" >&5
 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3080,7 +3140,7 @@ else
   ac_cv_type_getgroups=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 3084 "configure"
+#line 3144 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Rendell for this test.  */
@@ -3105,7 +3165,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:3109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
     ac_cv_type_getgroups=gid_t
 else
@@ -3119,7 +3179,7 @@ fi
 
 if test $ac_cv_type_getgroups = cross; then
         cat > conftest.$ac_ext <<EOF
-#line 3123 "configure"
+#line 3183 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 EOF
@@ -3143,12 +3203,12 @@ EOF
 
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:3147: checking for mode_t" >&5
+echo "configure:3207: checking for mode_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3152 "configure"
+#line 3212 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3176,12 +3236,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:3180: checking for off_t" >&5
+echo "configure:3240: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3185 "configure"
+#line 3245 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3209,12 +3269,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:3213: checking for pid_t" >&5
+echo "configure:3273: checking for pid_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3218 "configure"
+#line 3278 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3242,12 +3302,12 @@ EOF
 fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:3246: checking return type of signal handlers" >&5
+echo "configure:3306: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3251 "configure"
+#line 3311 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -3264,7 +3324,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:3268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3328: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -3283,12 +3343,12 @@ EOF
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3287: checking for size_t" >&5
+echo "configure:3347: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3292 "configure"
+#line 3352 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3316,12 +3376,12 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:3320: checking for uid_t in sys/types.h" >&5
+echo "configure:3380: checking for uid_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3325 "configure"
+#line 3385 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -3352,12 +3412,12 @@ fi
 
 
 echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:3356: checking whether stat file-mode macros are broken" >&5
+echo "configure:3416: checking whether stat file-mode macros are broken" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3361 "configure"
+#line 3421 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -3408,12 +3468,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:3412: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:3472: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3417 "configure"
+#line 3477 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -3422,7 +3482,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:3426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3486: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -3443,12 +3503,12 @@ EOF
 fi
 
 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:3447: checking for st_blksize in struct stat" >&5
+echo "configure:3507: checking for st_blksize in struct stat" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3452 "configure"
+#line 3512 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -3456,7 +3516,7 @@ int main() {
 struct stat s; s.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:3460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3520: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_blksize=yes
 else
@@ -3477,12 +3537,12 @@ EOF
 fi
  
 echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
-echo "configure:3481: checking for st_blocks in struct stat" >&5
+echo "configure:3541: checking for st_blocks in struct stat" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3486 "configure"
+#line 3546 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -3490,7 +3550,7 @@ int main() {
 struct stat s; s.st_blocks;
 ; return 0; }
 EOF
-if { (eval echo configure:3494: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3554: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_blocks=yes
 else
@@ -3513,12 +3573,12 @@ else
 fi
  
 echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6
-echo "configure:3517: checking for st_rdev in struct stat" >&5
+echo "configure:3577: checking for st_rdev in struct stat" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3522 "configure"
+#line 3582 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -3526,7 +3586,7 @@ int main() {
 struct stat s; s.st_rdev;
 ; return 0; }
 EOF
-if { (eval echo configure:3530: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3590: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_rdev=yes
 else
@@ -3547,12 +3607,12 @@ EOF
 fi
  
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:3551: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:3611: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3556 "configure"
+#line 3616 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -3560,7 +3620,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:3564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3624: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -3581,12 +3641,12 @@ EOF
 fi
 
 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:3585: checking for tm_zone in struct tm" >&5
+echo "configure:3645: checking for tm_zone in struct tm" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3590 "configure"
+#line 3650 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_cv_struct_tm>
@@ -3594,7 +3654,7 @@ int main() {
 struct tm tm; tm.tm_zone;
 ; return 0; }
 EOF
-if { (eval echo configure:3598: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm_zone=yes
 else
@@ -3614,12 +3674,12 @@ EOF
 
 else
   echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:3618: checking for tzname" >&5
+echo "configure:3678: checking for tzname" >&5
 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3623 "configure"
+#line 3683 "configure"
 #include "confdefs.h"
 #include <time.h>
 #ifndef tzname /* For SGI.  */
@@ -3629,7 +3689,7 @@ int main() {
 atoi(*tzname);
 ; return 0; }
 EOF
-if { (eval echo configure:3633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_var_tzname=yes
 else
@@ -3653,12 +3713,12 @@ fi
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3657: checking for working const" >&5
+echo "configure:3717: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3662 "configure"
+#line 3722 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -3707,7 +3767,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:3711: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3771: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -3728,21 +3788,21 @@ EOF
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:3732: checking for inline" >&5
+echo "configure:3792: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 3739 "configure"
+#line 3799 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:3746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3806: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -3768,14 +3828,14 @@ EOF
 esac
 
 echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
-echo "configure:3772: checking whether char is unsigned" >&5
+echo "configure:3832: checking whether char is unsigned" >&5
 if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test "$GCC" = yes; then
   # GCC predefines this symbol on systems where it applies.
 cat > conftest.$ac_ext <<EOF
-#line 3779 "configure"
+#line 3839 "configure"
 #include "confdefs.h"
 #ifdef __CHAR_UNSIGNED__
   yes
@@ -3797,7 +3857,7 @@ if test "$cross_compiling" = yes; then
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 3801 "configure"
+#line 3861 "configure"
 #include "confdefs.h"
 /* volatile prevents gcc2 from optimizing the test away on sparcs.  */
 #if !defined(__STDC__) || __STDC__ != 1
@@ -3807,7 +3867,7 @@ main() {
   volatile char c = 255; exit(c < 0);
 }
 EOF
-if { (eval echo configure:3811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_char_unsigned=yes
 else
@@ -3831,7 +3891,7 @@ EOF
 fi
 
 echo $ac_n "checking for long double""... $ac_c" 1>&6
-echo "configure:3835: checking for long double" >&5
+echo "configure:3895: checking for long double" >&5
 if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3842,7 +3902,7 @@ if test "$cross_compiling" = yes; then
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 3846 "configure"
+#line 3906 "configure"
 #include "confdefs.h"
 int main() {
 /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
@@ -3850,7 +3910,7 @@ long double foo = 0.0;
 /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
 exit(sizeof(long double) < sizeof(double)); }
 EOF
-if { (eval echo configure:3854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_long_double=yes
 else
@@ -3875,14 +3935,14 @@ fi
 
 
 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3879: checking whether byte ordering is bigendian" >&5
+echo "configure:3939: checking whether byte ordering is bigendian" >&5
 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
 cat > conftest.$ac_ext <<EOF
-#line 3886 "configure"
+#line 3946 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3893,11 +3953,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3957: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   # It does; now see whether it defined to BIG_ENDIAN or not.
 cat > conftest.$ac_ext <<EOF
-#line 3901 "configure"
+#line 3961 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3908,7 +3968,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3912: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -3928,7 +3988,7 @@ if test "$cross_compiling" = yes; then
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 3932 "configure"
+#line 3992 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -3941,7 +4001,7 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:3945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_bigendian=no
 else
@@ -3966,7 +4026,7 @@ fi
 
 
 echo $ac_n "checking size of int *""... $ac_c" 1>&6
-echo "configure:3970: checking size of int *" >&5
+echo "configure:4030: checking size of int *" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_int_p'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3974,7 +4034,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 3978 "configure"
+#line 4038 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3985,7 +4045,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:3989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_int_p=`cat conftestval`
 else
@@ -4005,7 +4065,7 @@ EOF
 
 
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:4009: checking size of int" >&5
+echo "configure:4069: checking size of int" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4013,7 +4073,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 4017 "configure"
+#line 4077 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -4024,7 +4084,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:4028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -4044,7 +4104,7 @@ EOF
 
 
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:4048: checking size of long" >&5
+echo "configure:4108: checking size of long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4052,7 +4112,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 4056 "configure"
+#line 4116 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -4063,7 +4123,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:4067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
@@ -4083,7 +4143,7 @@ EOF
 
 
 echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:4087: checking size of long long" >&5
+echo "configure:4147: checking size of long long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4091,7 +4151,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 4095 "configure"
+#line 4155 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -4102,7 +4162,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:4106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long_long=`cat conftestval`
 else
@@ -4126,7 +4186,7 @@ EOF
 
 
 echo $ac_n "checking for long file names""... $ac_c" 1>&6
-echo "configure:4130: checking for long file names" >&5
+echo "configure:4190: checking for long file names" >&5
 if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4177,7 +4237,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4181: checking for $ac_word" >&5
+echo "configure:4241: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4210,7 +4270,7 @@ test -n "$YACC" || YACC="yacc"
 # Extract the first word of "flex", so it can be a program name with args.
 set dummy flex; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4214: checking for $ac_word" >&5
+echo "configure:4274: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4243,7 +4303,7 @@ then
   *) ac_lib=l ;;
   esac
   echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:4247: checking for yywrap in -l$ac_lib" >&5
+echo "configure:4307: checking for yywrap in -l$ac_lib" >&5
 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4251,7 +4311,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$ac_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4255 "configure"
+#line 4315 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4262,7 +4322,7 @@ int main() {
 yywrap()
 ; return 0; }
 EOF
-if { (eval echo configure:4266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4285,7 +4345,7 @@ fi
 fi
 
 echo $ac_n "checking lex output file root""... $ac_c" 1>&6
-echo "configure:4289: checking lex output file root" >&5
+echo "configure:4349: checking lex output file root" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4306,7 +4366,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6
 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
 
 echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
-echo "configure:4310: checking whether yytext is a pointer" >&5
+echo "configure:4370: checking whether yytext is a pointer" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4318,14 +4378,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
 ac_save_LIBS="$LIBS"
 LIBS="$LIBS $LEXLIB"
 cat > conftest.$ac_ext <<EOF
-#line 4322 "configure"
+#line 4382 "configure"
 #include "confdefs.h"
 `cat $LEX_OUTPUT_ROOT.c`
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_prog_lex_yytext_pointer=yes
 else
@@ -4352,12 +4412,12 @@ DL_LIBRARY=
 for ac_func in dlopen
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4356: checking for $ac_func" >&5
+echo "configure:4416: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4361 "configure"
+#line 4421 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4380,7 +4440,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4405,7 +4465,7 @@ EOF
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:4409: checking for dlopen in -ldl" >&5
+echo "configure:4469: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4413,7 +4473,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4417 "configure"
+#line 4477 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4424,7 +4484,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:4428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4446,7 +4506,7 @@ EOF
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
-echo "configure:4450: checking for dld_link in -ldld" >&5
+echo "configure:4510: checking for dld_link in -ldld" >&5
 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4454,7 +4514,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldld  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4458 "configure"
+#line 4518 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4465,7 +4525,7 @@ int main() {
 dld_link()
 ; return 0; }
 EOF
-if { (eval echo configure:4469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4489,12 +4549,12 @@ else
 for ac_func in shl_load
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4493: checking for $ac_func" >&5
+echo "configure:4553: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4498 "configure"
+#line 4558 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4517,7 +4577,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4557,7 +4617,7 @@ done
 
 
 echo $ac_n "checking for underscore before symbols""... $ac_c" 1>&6
-echo "configure:4561: checking for underscore before symbols" >&5
+echo "configure:4621: checking for underscore before symbols" >&5
 if eval "test \"`echo '$''{'libltdl_cv_uscore'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4579,7 +4639,7 @@ if test x"$libltdl_cv_uscore" = xyes; then
   if test x"$ac_cv_func_dlopen" = xyes ||
      test x"$ac_cv_lib_dl_dlopen" = xyes ; then
 	echo $ac_n "checking whether we have to add an underscore for dlsym""... $ac_c" 1>&6
-echo "configure:4583: checking whether we have to add an underscore for dlsym" >&5
+echo "configure:4643: checking whether we have to add an underscore for dlsym" >&5
 if eval "test \"`echo '$''{'libltdl_cv_need_uscore'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4588,7 +4648,7 @@ else
 
 else
   cat > conftest.$ac_ext <<EOF
-#line 4592 "configure"
+#line 4652 "configure"
 #include "confdefs.h"
 
 #include <dlfcn.h>
@@ -4599,7 +4659,7 @@ main() { void *self, *ptr1, *ptr2; self=dlopen(NULL,RTLD_LAZY);
     if(ptr1 && !ptr2) exit(0); } exit(1); } 
 
 EOF
-if { (eval echo configure:4603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   libltdl_cv_need_uscore=no
 else
@@ -4628,12 +4688,12 @@ fi
 for ac_func in strerror
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4632: checking for $ac_func" >&5
+echo "configure:4692: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4637 "configure"
+#line 4697 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4656,7 +4716,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4693,7 +4753,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:4697: checking host system type" >&5
+echo "configure:4757: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -4940,7 +5000,7 @@ DEFAULT_wxUSE_WCSRTOMBS=0
 
 
 echo $ac_n "checking "for gtk"""... $ac_c" 1>&6
-echo "configure:4944: checking "for gtk"" >&5
+echo "configure:5004: checking "for gtk"" >&5
 # Check whether --with-gtk or --without-gtk was given.
 if test "${with_gtk+set}" = set; then
   withval="$with_gtk"
@@ -4970,7 +5030,7 @@ fi
 
 
 echo $ac_n "checking "for qt"""... $ac_c" 1>&6
-echo "configure:4974: checking "for qt"" >&5
+echo "configure:5034: checking "for qt"" >&5
 # Check whether --with-qt or --without-qt was given.
 if test "${with_qt+set}" = set; then
   withval="$with_qt"
@@ -5000,7 +5060,7 @@ fi
 
 
 echo $ac_n "checking "for motif"""... $ac_c" 1>&6
-echo "configure:5004: checking "for motif"" >&5
+echo "configure:5064: checking "for motif"" >&5
 # Check whether --with-motif or --without-motif was given.
 if test "${with_motif+set}" = set; then
   withval="$with_motif"
@@ -5031,7 +5091,7 @@ fi
 
 
 echo $ac_n "checking "for shared"""... $ac_c" 1>&6
-echo "configure:5035: checking "for shared"" >&5
+echo "configure:5095: checking "for shared"" >&5
 # Check whether --with-shared or --without-shared was given.
 if test "${with_shared+set}" = set; then
   withval="$with_shared"
@@ -5061,7 +5121,7 @@ fi
 
 
 echo $ac_n "checking "for optimise"""... $ac_c" 1>&6
-echo "configure:5065: checking "for optimise"" >&5
+echo "configure:5125: checking "for optimise"" >&5
 # Check whether --with-optimise or --without-optimise was given.
 if test "${with_optimise+set}" = set; then
   withval="$with_optimise"
@@ -5091,7 +5151,7 @@ fi
 
 
 echo $ac_n "checking "for debug_flag"""... $ac_c" 1>&6
-echo "configure:5095: checking "for debug_flag"" >&5
+echo "configure:5155: checking "for debug_flag"" >&5
 # Check whether --with-debug_flag or --without-debug_flag was given.
 if test "${with_debug_flag+set}" = set; then
   withval="$with_debug_flag"
@@ -5121,7 +5181,7 @@ fi
 
 
 echo $ac_n "checking "for debug_info"""... $ac_c" 1>&6
-echo "configure:5125: checking "for debug_info"" >&5
+echo "configure:5185: checking "for debug_info"" >&5
 # Check whether --with-debug_info or --without-debug_info was given.
 if test "${with_debug_info+set}" = set; then
   withval="$with_debug_info"
@@ -5151,7 +5211,7 @@ fi
 
 
 echo $ac_n "checking "for debug_gdb"""... $ac_c" 1>&6
-echo "configure:5155: checking "for debug_gdb"" >&5
+echo "configure:5215: checking "for debug_gdb"" >&5
 # Check whether --with-debug_gdb or --without-debug_gdb was given.
 if test "${with_debug_gdb+set}" = set; then
   withval="$with_debug_gdb"
@@ -5181,7 +5241,7 @@ fi
 
 
 echo $ac_n "checking "for mem_tracing"""... $ac_c" 1>&6
-echo "configure:5185: checking "for mem_tracing"" >&5
+echo "configure:5245: checking "for mem_tracing"" >&5
 # Check whether --with-mem_tracing or --without-mem_tracing was given.
 if test "${with_mem_tracing+set}" = set; then
   withval="$with_mem_tracing"
@@ -5211,7 +5271,7 @@ fi
 
 
 echo $ac_n "checking "for dmalloc"""... $ac_c" 1>&6
-echo "configure:5215: checking "for dmalloc"" >&5
+echo "configure:5275: checking "for dmalloc"" >&5
 # Check whether --with-dmalloc or --without-dmalloc was given.
 if test "${with_dmalloc+set}" = set; then
   withval="$with_dmalloc"
@@ -5241,7 +5301,7 @@ fi
 
 
 echo $ac_n "checking "for profile"""... $ac_c" 1>&6
-echo "configure:5245: checking "for profile"" >&5
+echo "configure:5305: checking "for profile"" >&5
 # Check whether --with-profile or --without-profile was given.
 if test "${with_profile+set}" = set; then
   withval="$with_profile"
@@ -5271,7 +5331,7 @@ fi
 
 
 echo $ac_n "checking "for apple_ieee"""... $ac_c" 1>&6
-echo "configure:5275: checking "for apple_ieee"" >&5
+echo "configure:5335: checking "for apple_ieee"" >&5
 # Check whether --with-apple_ieee or --without-apple_ieee was given.
 if test "${with_apple_ieee+set}" = set; then
   withval="$with_apple_ieee"
@@ -5301,7 +5361,7 @@ fi
 
 
 echo $ac_n "checking "for threads"""... $ac_c" 1>&6
-echo "configure:5305: checking "for threads"" >&5
+echo "configure:5365: checking "for threads"" >&5
 # Check whether --with-threads or --without-threads was given.
 if test "${with_threads+set}" = set; then
   withval="$with_threads"
@@ -5331,7 +5391,7 @@ fi
 
 
 echo $ac_n "checking "for dynlib"""... $ac_c" 1>&6
-echo "configure:5335: checking "for dynlib"" >&5
+echo "configure:5395: checking "for dynlib"" >&5
 # Check whether --with-dynlib or --without-dynlib was given.
 if test "${with_dynlib+set}" = set; then
   withval="$with_dynlib"
@@ -5362,7 +5422,7 @@ fi
 
 
 echo $ac_n "checking "for zlib"""... $ac_c" 1>&6
-echo "configure:5366: checking "for zlib"" >&5
+echo "configure:5426: checking "for zlib"" >&5
 # Check whether --with-zlib or --without-zlib was given.
 if test "${with_zlib+set}" = set; then
   withval="$with_zlib"
@@ -5392,7 +5452,7 @@ fi
 
 
 echo $ac_n "checking "for libpng"""... $ac_c" 1>&6
-echo "configure:5396: checking "for libpng"" >&5
+echo "configure:5456: checking "for libpng"" >&5
 # Check whether --with-libpng or --without-libpng was given.
 if test "${with_libpng+set}" = set; then
   withval="$with_libpng"
@@ -5422,7 +5482,7 @@ fi
 
 
 echo $ac_n "checking "for libjpeg"""... $ac_c" 1>&6
-echo "configure:5426: checking "for libjpeg"" >&5
+echo "configure:5486: checking "for libjpeg"" >&5
 # Check whether --with-libjpeg or --without-libjpeg was given.
 if test "${with_libjpeg+set}" = set; then
   withval="$with_libjpeg"
@@ -5452,7 +5512,7 @@ fi
 
 
 echo $ac_n "checking "for odbc"""... $ac_c" 1>&6
-echo "configure:5456: checking "for odbc"" >&5
+echo "configure:5516: checking "for odbc"" >&5
 # Check whether --with-odbc or --without-odbc was given.
 if test "${with_odbc+set}" = set; then
   withval="$with_odbc"
@@ -5483,7 +5543,7 @@ fi
 
 
 echo $ac_n "checking "for timedate"""... $ac_c" 1>&6
-echo "configure:5487: checking "for timedate"" >&5
+echo "configure:5547: checking "for timedate"" >&5
 # Check whether --with-timedate or --without-timedate was given.
 if test "${with_timedate+set}" = set; then
   withval="$with_timedate"
@@ -5513,7 +5573,7 @@ fi
 
 
 echo $ac_n "checking "for intl"""... $ac_c" 1>&6
-echo "configure:5517: checking "for intl"" >&5
+echo "configure:5577: checking "for intl"" >&5
 # Check whether --with-intl or --without-intl was given.
 if test "${with_intl+set}" = set; then
   withval="$with_intl"
@@ -5543,7 +5603,7 @@ fi
 
 
 echo $ac_n "checking "for config"""... $ac_c" 1>&6
-echo "configure:5547: checking "for config"" >&5
+echo "configure:5607: checking "for config"" >&5
 # Check whether --with-config or --without-config was given.
 if test "${with_config+set}" = set; then
   withval="$with_config"
@@ -5573,7 +5633,7 @@ fi
 
 
 echo $ac_n "checking "for streams"""... $ac_c" 1>&6
-echo "configure:5577: checking "for streams"" >&5
+echo "configure:5637: checking "for streams"" >&5
 # Check whether --with-streams or --without-streams was given.
 if test "${with_streams+set}" = set; then
   withval="$with_streams"
@@ -5603,7 +5663,7 @@ fi
 
 
 echo $ac_n "checking "for serial"""... $ac_c" 1>&6
-echo "configure:5607: checking "for serial"" >&5
+echo "configure:5667: checking "for serial"" >&5
 # Check whether --with-serial or --without-serial was given.
 if test "${with_serial+set}" = set; then
   withval="$with_serial"
@@ -5633,7 +5693,7 @@ fi
 
 
 echo $ac_n "checking "for sockets"""... $ac_c" 1>&6
-echo "configure:5637: checking "for sockets"" >&5
+echo "configure:5697: checking "for sockets"" >&5
 # Check whether --with-sockets or --without-sockets was given.
 if test "${with_sockets+set}" = set; then
   withval="$with_sockets"
@@ -5664,7 +5724,7 @@ fi
 
 
 echo $ac_n "checking "for afmfonts"""... $ac_c" 1>&6
-echo "configure:5668: checking "for afmfonts"" >&5
+echo "configure:5728: checking "for afmfonts"" >&5
 # Check whether --with-afmfonts or --without-afmfonts was given.
 if test "${with_afmfonts+set}" = set; then
   withval="$with_afmfonts"
@@ -5694,7 +5754,7 @@ fi
 
 
 echo $ac_n "checking "for normalized"""... $ac_c" 1>&6
-echo "configure:5698: checking "for normalized"" >&5
+echo "configure:5758: checking "for normalized"" >&5
 # Check whether --with-normalized or --without-normalized was given.
 if test "${with_normalized+set}" = set; then
   withval="$with_normalized"
@@ -5724,7 +5784,7 @@ fi
 
 
 echo $ac_n "checking "for postscript"""... $ac_c" 1>&6
-echo "configure:5728: checking "for postscript"" >&5
+echo "configure:5788: checking "for postscript"" >&5
 # Check whether --with-postscript or --without-postscript was given.
 if test "${with_postscript+set}" = set; then
   withval="$with_postscript"
@@ -5755,7 +5815,7 @@ fi
 
 
 echo $ac_n "checking "for unicode"""... $ac_c" 1>&6
-echo "configure:5759: checking "for unicode"" >&5
+echo "configure:5819: checking "for unicode"" >&5
 # Check whether --with-unicode or --without-unicode was given.
 if test "${with_unicode+set}" = set; then
   withval="$with_unicode"
@@ -5785,7 +5845,7 @@ fi
 
 
 echo $ac_n "checking "for wcsrtombs"""... $ac_c" 1>&6
-echo "configure:5789: checking "for wcsrtombs"" >&5
+echo "configure:5849: checking "for wcsrtombs"" >&5
 # Check whether --with-wcsrtombs or --without-wcsrtombs was given.
 if test "${with_wcsrtombs+set}" = set; then
   withval="$with_wcsrtombs"
@@ -5816,7 +5876,7 @@ fi
 
 
 echo $ac_n "checking "for wxresources"""... $ac_c" 1>&6
-echo "configure:5820: checking "for wxresources"" >&5
+echo "configure:5880: checking "for wxresources"" >&5
 # Check whether --with-wxresources or --without-wxresources was given.
 if test "${with_wxresources+set}" = set; then
   withval="$with_wxresources"
@@ -5846,7 +5906,7 @@ fi
 
 
 echo $ac_n "checking "for prologio"""... $ac_c" 1>&6
-echo "configure:5850: checking "for prologio"" >&5
+echo "configure:5910: checking "for prologio"" >&5
 # Check whether --with-prologio or --without-prologio was given.
 if test "${with_prologio+set}" = set; then
   withval="$with_prologio"
@@ -5876,7 +5936,7 @@ fi
 
 
 echo $ac_n "checking "for RPC"""... $ac_c" 1>&6
-echo "configure:5880: checking "for RPC"" >&5
+echo "configure:5940: checking "for RPC"" >&5
 # Check whether --with-rpc or --without-rpc was given.
 if test "${with_rpc+set}" = set; then
   withval="$with_rpc"
@@ -5907,7 +5967,7 @@ fi
 
 
 echo $ac_n "checking "for IPC"""... $ac_c" 1>&6
-echo "configure:5911: checking "for IPC"" >&5
+echo "configure:5971: checking "for IPC"" >&5
 # Check whether --with-ipc or --without-ipc was given.
 if test "${with_ipc+set}" = set; then
   withval="$with_ipc"
@@ -5937,7 +5997,7 @@ fi
 
 
 echo $ac_n "checking "for resources"""... $ac_c" 1>&6
-echo "configure:5941: checking "for resources"" >&5
+echo "configure:6001: checking "for resources"" >&5
 # Check whether --with-resources or --without-resources was given.
 if test "${with_resources+set}" = set; then
   withval="$with_resources"
@@ -5967,7 +6027,7 @@ fi
 
 
 echo $ac_n "checking "for clipboard"""... $ac_c" 1>&6
-echo "configure:5971: checking "for clipboard"" >&5
+echo "configure:6031: checking "for clipboard"" >&5
 # Check whether --with-clipboard or --without-clipboard was given.
 if test "${with_clipboard+set}" = set; then
   withval="$with_clipboard"
@@ -5997,7 +6057,7 @@ fi
 
 
 echo $ac_n "checking "for tooltips"""... $ac_c" 1>&6
-echo "configure:6001: checking "for tooltips"" >&5
+echo "configure:6061: checking "for tooltips"" >&5
 # Check whether --with-tooltips or --without-tooltips was given.
 if test "${with_tooltips+set}" = set; then
   withval="$with_tooltips"
@@ -6027,7 +6087,7 @@ fi
 
 
 echo $ac_n "checking "for dnd"""... $ac_c" 1>&6
-echo "configure:6031: checking "for dnd"" >&5
+echo "configure:6091: checking "for dnd"" >&5
 # Check whether --with-dnd or --without-dnd was given.
 if test "${with_dnd+set}" = set; then
   withval="$with_dnd"
@@ -6058,7 +6118,7 @@ fi
 
 
 echo $ac_n "checking "for mdi"""... $ac_c" 1>&6
-echo "configure:6062: checking "for mdi"" >&5
+echo "configure:6122: checking "for mdi"" >&5
 # Check whether --with-mdi or --without-mdi was given.
 if test "${with_mdi+set}" = set; then
   withval="$with_mdi"
@@ -6088,7 +6148,7 @@ fi
 
 
 echo $ac_n "checking "for docview"""... $ac_c" 1>&6
-echo "configure:6092: checking "for docview"" >&5
+echo "configure:6152: checking "for docview"" >&5
 # Check whether --with-docview or --without-docview was given.
 if test "${with_docview+set}" = set; then
   withval="$with_docview"
@@ -6118,7 +6178,7 @@ fi
 
 
 echo $ac_n "checking "for printarch"""... $ac_c" 1>&6
-echo "configure:6122: checking "for printarch"" >&5
+echo "configure:6182: checking "for printarch"" >&5
 # Check whether --with-printarch or --without-printarch was given.
 if test "${with_printarch+set}" = set; then
   withval="$with_printarch"
@@ -6148,7 +6208,7 @@ fi
 
 
 echo $ac_n "checking "for help"""... $ac_c" 1>&6
-echo "configure:6152: checking "for help"" >&5
+echo "configure:6212: checking "for help"" >&5
 # Check whether --with-help or --without-help was given.
 if test "${with_help+set}" = set; then
   withval="$with_help"
@@ -6186,7 +6246,7 @@ fi
 
 if test "$USE_LINUX" = 1; then
 	echo $ac_n "checking for gettext in -lc""... $ac_c" 1>&6
-echo "configure:6190: checking for gettext in -lc" >&5
+echo "configure:6250: checking for gettext in -lc" >&5
 ac_lib_var=`echo c'_'gettext | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6194,7 +6254,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6198 "configure"
+#line 6258 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6205,7 +6265,7 @@ int main() {
 gettext()
 ; return 0; }
 EOF
-if { (eval echo configure:6209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6276,7 +6336,7 @@ fi
   # Extract the first word of "gtk-config", so it can be a program name with args.
 set dummy gtk-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6280: checking for $ac_word" >&5
+echo "configure:6340: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6307,7 +6367,7 @@ fi
 
   min_gtk_version=1.0.4
   echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6
-echo "configure:6311: checking for GTK - version >= $min_gtk_version" >&5
+echo "configure:6371: checking for GTK - version >= $min_gtk_version" >&5
   no_gtk=""
   if test "$GTK_CONFIG" != "no" ; then
     GTK_CFLAGS=`$GTK_CONFIG --cflags`
@@ -6320,7 +6380,7 @@ echo "configure:6311: checking for GTK - version >= $min_gtk_version" >&5
   echo $ac_n "cross compiling; assumed OK... $ac_c"
 else
   cat > conftest.$ac_ext <<EOF
-#line 6324 "configure"
+#line 6384 "configure"
 #include "confdefs.h"
 
 #include <gtk/gtk.h>
@@ -6344,7 +6404,7 @@ main ()
 }
 
 EOF
-if { (eval echo configure:6348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -6384,7 +6444,7 @@ fi
 
 if test "$wxUSE_QT" = 1; then
    echo $ac_n "checking for Qt includes""... $ac_c" 1>&6
-echo "configure:6388: checking for Qt includes" >&5
+echo "configure:6448: checking for Qt includes" >&5
    
 ac_find_includes=
 for ac_dir in $SEARCH_INCLUDE;
@@ -6398,7 +6458,7 @@ for ac_dir in $SEARCH_INCLUDE;
    if test "$ac_find_includes" != "" ; then
      echo "$ac_t""found $ac_find_includes" 1>&6
      echo $ac_n "checking for Qt library""... $ac_c" 1>&6
-echo "configure:6402: checking for Qt library" >&5
+echo "configure:6462: checking for Qt library" >&5
      
 ac_find_libraries=
 for ac_dir in $SEARCH_LIB;
@@ -6449,7 +6509,7 @@ fi
 
 if test "$wxUSE_MOTIF" = 1; then
    echo $ac_n "checking for Motif/Lesstif includes""... $ac_c" 1>&6
-echo "configure:6453: checking for Motif/Lesstif includes" >&5
+echo "configure:6513: checking for Motif/Lesstif includes" >&5
    
 ac_find_includes=
 for ac_dir in $SEARCH_INCLUDE;
@@ -6463,7 +6523,7 @@ for ac_dir in $SEARCH_INCLUDE;
    if test "$ac_find_includes" != "" ; then
      echo "$ac_t""found $ac_find_includes" 1>&6
      echo $ac_n "checking for Motif/Lesstif library""... $ac_c" 1>&6
-echo "configure:6467: checking for Motif/Lesstif library" >&5
+echo "configure:6527: checking for Motif/Lesstif library" >&5
      
 ac_find_libraries=
 for ac_dir in $SEARCH_LIB;
@@ -6500,7 +6560,7 @@ for ac_dir in $SEARCH_LIB;
        CHECK_INCLUDE="$CHECK_INCLUDE $ac_path_to_include"
        echo "$ac_t""found at $ac_find_libraries" 1>&6
        echo $ac_n "checking for Xt library""... $ac_c" 1>&6
-echo "configure:6504: checking for Xt library" >&5
+echo "configure:6564: checking for Xt library" >&5
        
 ac_find_libraries=
 for ac_dir in $SEARCH_LIB;
@@ -6526,7 +6586,7 @@ for ac_dir in $SEARCH_LIB;
          CHECK_LINK="$CHECK_LIB $ac_path_to_link"
          echo "$ac_t""found at $ac_find_libraries" 1>&6
          echo $ac_n "checking for Xpm library""... $ac_c" 1>&6
-echo "configure:6530: checking for Xpm library" >&5
+echo "configure:6590: checking for Xpm library" >&5
          
 ac_find_libraries=
 for ac_dir in $SEARCH_LIB;
@@ -6698,7 +6758,7 @@ if test "$wxUSE_LIBJPEG" = 1 ; then
 EOF
 
   echo $ac_n "checking for  in -ljpeg""... $ac_c" 1>&6
-echo "configure:6702: checking for  in -ljpeg" >&5
+echo "configure:6762: checking for  in -ljpeg" >&5
 ac_lib_var=`echo jpeg'_' | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6706,7 +6766,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ljpeg  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6710 "configure"
+#line 6770 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6717,7 +6777,7 @@ int main() {
 ()
 ; return 0; }
 EOF
-if { (eval echo configure:6721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6807,12 +6867,12 @@ if test "$wxUSE_DYNLIB_CLASS" = "1"; then
             for ac_func in dlopen
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6811: checking for $ac_func" >&5
+echo "configure:6871: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6816 "configure"
+#line 6876 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6835,7 +6895,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6860,7 +6920,7 @@ EOF
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:6864: checking for dlopen in -ldl" >&5
+echo "configure:6924: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6868,7 +6928,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6872 "configure"
+#line 6932 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6879,7 +6939,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:6883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6908,12 +6968,12 @@ done
     for ac_func in shl_load
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6912: checking for $ac_func" >&5
+echo "configure:6972: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6917 "configure"
+#line 6977 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6936,7 +6996,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7110,7 +7170,7 @@ if test "$wxUSE_THREADS" = "1"; then
 
      
      echo $ac_n "checking for pthread_create in -lpthread-0.7""... $ac_c" 1>&6
-echo "configure:7114: checking for pthread_create in -lpthread-0.7" >&5
+echo "configure:7174: checking for pthread_create in -lpthread-0.7" >&5
 ac_lib_var=`echo pthread-0.7'_'pthread_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7118,7 +7178,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread-0.7  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7122 "configure"
+#line 7182 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7129,7 +7189,7 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:7133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7153,17 +7213,17 @@ else
 
        ac_safe=`echo "sys/prctl.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/prctl.h""... $ac_c" 1>&6
-echo "configure:7157: checking for sys/prctl.h" >&5
+echo "configure:7217: checking for sys/prctl.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7162 "configure"
+#line 7222 "configure"
 #include "confdefs.h"
 #include <sys/prctl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7167: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7227: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7189,7 +7249,7 @@ fi
 
           
      echo $ac_n "checking for pthread_setcanceltype in -lpthread""... $ac_c" 1>&6
-echo "configure:7193: checking for pthread_setcanceltype in -lpthread" >&5
+echo "configure:7253: checking for pthread_setcanceltype in -lpthread" >&5
 ac_lib_var=`echo pthread'_'pthread_setcanceltype | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7197,7 +7257,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7201 "configure"
+#line 7261 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7208,7 +7268,7 @@ int main() {
 pthread_setcanceltype()
 ; return 0; }
 EOF
-if { (eval echo configure:7212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7244,7 +7304,7 @@ EOF
 
     
     echo $ac_n "checking for printf in -lposix4""... $ac_c" 1>&6
-echo "configure:7248: checking for printf in -lposix4" >&5
+echo "configure:7308: checking for printf in -lposix4" >&5
 ac_lib_var=`echo posix4'_'printf | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7252,7 +7312,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lposix4  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7256 "configure"
+#line 7316 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7263,7 +7323,7 @@ int main() {
 printf()
 ; return 0; }
 EOF
-if { (eval echo configure:7267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:7327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
diff --git a/configure.in b/configure.in
index 6fbadd6a52..e0b38d64a6 100644
--- a/configure.in
+++ b/configure.in
@@ -450,7 +450,10 @@ AC_SUBST(GTK_JOYSTICK)
 dnl check for vprintf/vsprintf() which are GNU extensions
 AC_FUNC_VPRINTF
 dnl check for vsnprintf() which is another GNU extension
-AC_CHECK_FUNC(vsnprintf, AC_DEFINE(HAVE_VSNPRINTF))
+AC_CHECK_FUNCS(vsnprintf)
+
+dnl check for usleep() and nanosleep() which is better in MT programs
+AC_CHECK_FUNCS(nanosleep usleep)
 
 AC_LANG_SAVE
 AC_LANG_CPLUSPLUS
diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex
index 3ec711a247..7b251945a5 100644
--- a/docs/latex/wx/function.tex
+++ b/docs/latex/wx/function.tex
@@ -1434,6 +1434,18 @@ This function is now obsolete, replaced by \helpref{Log functions}{logfunctions}
 
 <wx/memory.h>
 
+\membersection{::wxUsleep}\label{wxusleep}
+
+\func{void}{wxUsleep}{\param{unsigned long}{ milliseconds}}
+
+Sleeps for the specified number of milliseconds. Notice that usage of this
+function is encouraged instead of calling usleep(3) directly because the
+standard usleep() function is not MT safe.
+
+\wxheading{Include files}
+
+<wx/utils.h>
+
 \membersection{::wxWriteResource}\label{wxwriteresource}
 
 \func{bool}{wxWriteResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
diff --git a/include/wx/utils.h b/include/wx/utils.h
index 7a6fc52806..222e822c5b 100644
--- a/include/wx/utils.h
+++ b/include/wx/utils.h
@@ -49,13 +49,13 @@ class WXDLLEXPORT wxFrame;
 #define   wxToLower(C)      (((C) >= 'A' && (C) <= 'Z')? (C) - 'A' + 'a': (C))
 
 // Return a string with the current date/time
-WXDLLEXPORT wxString wxNow(void);
+WXDLLEXPORT wxString wxNow();
 
 // Make a copy of this string using 'new'
 WXDLLEXPORT char* copystring(const char *s);
 
 // Generate a unique ID
-WXDLLEXPORT long wxNewId(void);
+WXDLLEXPORT long wxNewId();
 #define NewId wxNewId
 
 // Ensure subsequent IDs don't clash with this one
@@ -63,7 +63,7 @@ WXDLLEXPORT void wxRegisterId(long id);
 #define RegisterId wxRegisterId
 
 // Return the current ID
-WXDLLEXPORT long wxGetCurrentId(void);
+WXDLLEXPORT long wxGetCurrentId();
 
 // Useful buffer
 WXDLLEXPORT_DATA(extern char*) wxBuffer;
@@ -111,11 +111,14 @@ WXDLLEXPORT bool wxShell(const wxString& command = wxEmptyString);
 // Sleep for nSecs seconds under UNIX, do nothing under Windows
 WXDLLEXPORT void wxSleep(int nSecs);
 
+// Sleep for a given amount of milliseconds
+WXDLLEXPORT void wxUsleep(unsigned long milliseconds);
+
 // Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
-WXDLLEXPORT long wxGetFreeMemory(void);
+WXDLLEXPORT long wxGetFreeMemory();
 
 // Consume all events until no more left
-WXDLLEXPORT void wxFlushEvents(void);
+WXDLLEXPORT void wxFlushEvents();
 
 /*
  * Network and username functions.
@@ -166,7 +169,7 @@ WXDLLEXPORT int wxFindMenuItemId(wxFrame *frame, const wxString& menuString, con
 #define wxMin(a,b)            (((a) < (b)) ? (a) : (b))
 
 // Yield to other apps/messages
-WXDLLEXPORT bool wxYield(void);
+WXDLLEXPORT bool wxYield();
 
 // Format a message on the standard error (UNIX) or the debugging
 // stream (Windows)
@@ -184,20 +187,22 @@ WXDLLEXPORT_DATA(extern wxCursor*) wxHOURGLASS_CURSOR;
 WXDLLEXPORT void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
 
 // Restore cursor to normal
-WXDLLEXPORT void wxEndBusyCursor(void);
+WXDLLEXPORT void wxEndBusyCursor();
  
 // TRUE if we're between the above two calls
-WXDLLEXPORT bool wxIsBusy(void);
+WXDLLEXPORT bool wxIsBusy();
 
 // Convenience class so we can just create a wxBusyCursor object on the stack
 class WXDLLEXPORT wxBusyCursor
 {
- public:
-    inline wxBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR) { wxBeginBusyCursor(cursor); }
-    inline ~wxBusyCursor() { wxEndBusyCursor(); }
+public:
+    wxBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR)
+        { wxBeginBusyCursor(cursor); }
+   ~wxBusyCursor()
+        { wxEndBusyCursor(); }
 };
 
-/* Error message functions used by wxWindows */
+// Error message functions used by wxWindows
 
 // Non-fatal error (continues)
 WXDLLEXPORT_DATA(extern const char*) wxInternalErrorStr;
diff --git a/setup/setup.hin b/setup/setup.hin
index b996011429..4e03e7f79e 100644
--- a/setup/setup.hin
+++ b/setup/setup.hin
@@ -374,6 +374,18 @@
 /* Define if you have vsnprintf() */
 #undef HAVE_VSNPRINTF
 
+/* Define if you have usleep() */
+#undef HAVE_USLEEP
+
+/* Define if you have nanosleep() */
+#undef HAVE_NANOSLEEP
+
+/* Define if you have usleep() */
+#undef HAVE_USLEEP
+
+/* Define if you have nanosleep() */
+#undef HAVE_NANOSLEEP
+
 /* Define if your system has its own `getloadavg' function.  */
 #undef HAVE_GETLOADAVG
 
diff --git a/src/common/object.cpp b/src/common/object.cpp
index 734a4d5085..8c1f4febb7 100644
--- a/src/common/object.cpp
+++ b/src/common/object.cpp
@@ -54,20 +54,20 @@ wxHashTable* wxClassInfo::sm_classTable = (wxHashTable*) NULL;
  * wxWindows root object.
  */
 
-wxObject::wxObject(void)
+wxObject::wxObject()
 {
-  m_refData = (wxObjectRefData *) NULL;
+    m_refData = (wxObjectRefData *) NULL;
 #if wxUSE_SERIAL
-  m_serialObj = (wxObject_Serialize *)NULL;
+    m_serialObj = (wxObject_Serialize *)NULL;
 #endif
 }
 
-wxObject::~wxObject(void)
+wxObject::~wxObject()
 {
-	UnRef();
+    UnRef();
 #if wxUSE_SERIAL
-	if (m_serialObj)
-	  delete m_serialObj;
+    if (m_serialObj)
+        delete m_serialObj;
 #endif
 }
 
@@ -77,23 +77,23 @@ wxObject::~wxObject(void)
  * Go from this class to superclass, taking into account
  * two possible base classes.
  */
- 
+
 bool wxObject::IsKindOf(wxClassInfo *info) const
 {
-  wxClassInfo *thisInfo = GetClassInfo();
-  if (thisInfo)
-    return thisInfo->IsKindOf(info);
-  else
-    return FALSE;
+    wxClassInfo *thisInfo = GetClassInfo();
+    if (thisInfo)
+        return thisInfo->IsKindOf(info);
+    else
+        return FALSE;
 }
 
 #if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT
 void wxObject::Dump(ostream& str)
 {
-  if (GetClassInfo() && GetClassInfo()->GetClassName())
-    str << GetClassInfo()->GetClassName();
-  else
-    str << "unknown object class";
+    if (GetClassInfo() && GetClassInfo()->GetClassName())
+        str << GetClassInfo()->GetClassName();
+    else
+        str << "unknown object class";
 }
 #endif
 
@@ -103,21 +103,21 @@ void wxObject::Dump(ostream& str)
 #undef new
 #endif
 
-void * wxObject::operator new (size_t size, char * fileName, int lineNum)
+void *wxObject::operator new (size_t size, char * fileName, int lineNum)
 {
-  return wxDebugAlloc(size, fileName, lineNum, TRUE);
+    return wxDebugAlloc(size, fileName, lineNum, TRUE);
 }
 
 void wxObject::operator delete (void * buf)
 {
-  wxDebugFree(buf);
+    wxDebugFree(buf);
 }
 
 // VC++ 6.0
 #if defined(__VISUALC__) && (__VISUALC__ >= 1200)
 void wxObject::operator delete(void* pData, char* /* fileName */, int /* lineNum */)
 {
- ::operator delete(pData);
+    ::operator delete(pData);
 }
 #endif
 
@@ -125,12 +125,12 @@ void wxObject::operator delete(void* pData, char* /* fileName */, int /* lineNum
 #if !defined(__VISUALC__) && wxUSE_ARRAY_MEMORY_OPERATORS
 void * wxObject::operator new[] (size_t size, char * fileName, int lineNum)
 {
-  return wxDebugAlloc(size, fileName, lineNum, TRUE, TRUE);
+    return wxDebugAlloc(size, fileName, lineNum, TRUE, TRUE);
 }
 
 void wxObject::operator delete[] (void * buf)
 {
-  wxDebugFree(buf, TRUE);
+    wxDebugFree(buf, TRUE);
 }
 #endif
 
@@ -142,97 +142,97 @@ void wxObject::operator delete[] (void * buf)
 
 wxClassInfo::wxClassInfo(char *cName, char *baseName1, char *baseName2, int sz, wxObjectConstructorFn constr)
 {
-  m_className = cName;
-  m_baseClassName1 = baseName1;
-  m_baseClassName2 = baseName2;
-
-  m_objectSize = sz;
-  m_objectConstructor = constr;
-  
-  m_next = sm_first;
-  sm_first = this;
-
-  m_baseInfo1 = (wxClassInfo *) NULL;
-  m_baseInfo2 = (wxClassInfo *) NULL;
+    m_className = cName;
+    m_baseClassName1 = baseName1;
+    m_baseClassName2 = baseName2;
+
+    m_objectSize = sz;
+    m_objectConstructor = constr;
+
+    m_next = sm_first;
+    sm_first = this;
+
+    m_baseInfo1 = (wxClassInfo *) NULL;
+    m_baseInfo2 = (wxClassInfo *) NULL;
 }
 
-wxObject *wxClassInfo::CreateObject(void)
+wxObject *wxClassInfo::CreateObject()
 {
-  if (m_objectConstructor)
-    return (wxObject *)(*m_objectConstructor)();
-  else
-    return (wxObject *) NULL;
+    if (m_objectConstructor)
+        return (wxObject *)(*m_objectConstructor)();
+    else
+        return (wxObject *) NULL;
 }
 
 wxClassInfo *wxClassInfo::FindClass(char *c)
 {
-  wxClassInfo *p = sm_first;
-  while (p)
-  {
-    if (p && p->GetClassName() && strcmp(p->GetClassName(), c) == 0)
-      return p;
-    p = p->m_next;
-  }
-  return (wxClassInfo *) NULL;
+    wxClassInfo *p = sm_first;
+    while (p)
+    {
+        if (p && p->GetClassName() && strcmp(p->GetClassName(), c) == 0)
+            return p;
+        p = p->m_next;
+    }
+    return (wxClassInfo *) NULL;
 }
 
 // Climb upwards through inheritance hierarchy.
 // Dual inheritance is catered for.
 bool wxClassInfo::IsKindOf(wxClassInfo *info) const
 {
-  if (info == NULL)
-    return FALSE;
-
-  // For some reason, when making/using a DLL, static data has to be included
-  // in both the DLL and the application. This can lead to duplicate
-  // wxClassInfo objects, so we have to test the name instead of the pointers.
-  // PROBABLY NO LONGER TRUE now I've done DLL creation right.
-/*
+    if (info == NULL)
+        return FALSE;
+
+    // For some reason, when making/using a DLL, static data has to be included
+    // in both the DLL and the application. This can lead to duplicate
+    // wxClassInfo objects, so we have to test the name instead of the pointers.
+    // PROBABLY NO LONGER TRUE now I've done DLL creation right.
+    /*
 #if WXMAKINGDLL
-  if (GetClassName() && info->GetClassName() && (strcmp(GetClassName(), info->GetClassName()) == 0))
-    return TRUE;
+if (GetClassName() && info->GetClassName() && (strcmp(GetClassName(), info->GetClassName()) == 0))
+return TRUE;
 #else
-*/
-  if (this == info)
-    return TRUE;
+     */
+    if (this == info)
+        return TRUE;
 
-  if (m_baseInfo1)
-    if (m_baseInfo1->IsKindOf(info))
-      return TRUE;
+    if (m_baseInfo1)
+        if (m_baseInfo1->IsKindOf(info))
+            return TRUE;
 
-  if (m_baseInfo2)
-    return m_baseInfo2->IsKindOf(info);
+    if (m_baseInfo2)
+        return m_baseInfo2->IsKindOf(info);
 
-  return FALSE;
+    return FALSE;
 }
 
 // Set pointers to base class(es) to speed up IsKindOf
-void wxClassInfo::InitializeClasses(void)
+void wxClassInfo::InitializeClasses()
 {
-  wxClassInfo::sm_classTable = new wxHashTable(wxKEY_STRING);
-
-  // Index all class infos by their class name
-  wxClassInfo *info = sm_first;
-  while (info)
-  {
-    if (info->m_className)
-      sm_classTable->Put(info->m_className, (wxObject *)info);
-    info = info->m_next;
-  }
-
-  // Set base pointers for each wxClassInfo
-  info = sm_first;
-  while (info)
-  {
-    if (info->GetBaseClassName1())
-      info->m_baseInfo1 = (wxClassInfo *)sm_classTable->Get(info->GetBaseClassName1());
-    if (info->GetBaseClassName2())
-      info->m_baseInfo2 = (wxClassInfo *)sm_classTable->Get(info->GetBaseClassName2());
-    info = info->m_next;
-  }
+    wxClassInfo::sm_classTable = new wxHashTable(wxKEY_STRING);
+
+    // Index all class infos by their class name
+    wxClassInfo *info = sm_first;
+    while (info)
+    {
+        if (info->m_className)
+            sm_classTable->Put(info->m_className, (wxObject *)info);
+        info = info->m_next;
+    }
+
+    // Set base pointers for each wxClassInfo
+    info = sm_first;
+    while (info)
+    {
+        if (info->GetBaseClassName1())
+            info->m_baseInfo1 = (wxClassInfo *)sm_classTable->Get(info->GetBaseClassName1());
+        if (info->GetBaseClassName2())
+            info->m_baseInfo2 = (wxClassInfo *)sm_classTable->Get(info->GetBaseClassName2());
+        info = info->m_next;
+    }
 }
 
-void wxClassInfo::CleanUpClasses(void)
+void wxClassInfo::CleanUpClasses()
 {
     delete wxClassInfo::sm_classTable;
     wxClassInfo::sm_classTable = NULL;
@@ -270,54 +270,54 @@ wxObject *wxCreateDynamicObject(const char *name)
 
 wxObject* wxCreateStoredObject( wxInputStream &stream )
 {
-  wxObjectInputStream obj_s(stream);
-  return obj_s.LoadObject();
+    wxObjectInputStream obj_s(stream);
+    return obj_s.LoadObject();
 };
 
 void wxObject::StoreObject( wxObjectOutputStream& stream )
 {
-  wxString obj_name = wxString(GetClassInfo()->GetClassName()) + "_Serialize";
-  wxLibrary *lib = wxTheLibraries.LoadLibrary("wxserial");
-
-  if (!lib) {
-    wxLogError(_("Can't load wxSerial dynamic library."));
-    return;
-  }
-  if (!m_serialObj) {
-    m_serialObj = (WXSERIAL(wxObject) *)lib->CreateObject( obj_name );
+    wxString obj_name = wxString(GetClassInfo()->GetClassName()) + "_Serialize";
+    wxLibrary *lib = wxTheLibraries.LoadLibrary("wxserial");
 
+    if (!lib) {
+        wxLogError(_("Can't load wxSerial dynamic library."));
+        return;
+    }
     if (!m_serialObj) {
-      wxLogError(_("Can't find the serialization object '%s' "
-                   "for the object '%s'."),
-                 obj_name.c_str(),
-                 GetClassInfo()->GetClassName());
-      return;
+        m_serialObj = (WXSERIAL(wxObject) *)lib->CreateObject( obj_name );
+
+        if (!m_serialObj) {
+            wxLogError(_("Can't find the serialization object '%s' "
+                        "for the object '%s'."),
+                    obj_name.c_str(),
+                    GetClassInfo()->GetClassName());
+            return;
+        }
+        m_serialObj->SetObject(this);
     }
-    m_serialObj->SetObject(this);
-  }
 
-  m_serialObj->StoreObject(stream);
+    m_serialObj->StoreObject(stream);
 }
 
 void wxObject::LoadObject( wxObjectInputStream& stream )
 {
-  wxString obj_name = wxString(GetClassInfo()->GetClassName()) + "_Serialize";
-  wxLibrary *lib = wxTheLibraries.LoadLibrary("wxserial");
-
-  if (!m_serialObj) {
-    m_serialObj = (WXSERIAL(wxObject) *)lib->CreateObject( obj_name );
+    wxString obj_name = wxString(GetClassInfo()->GetClassName()) + "_Serialize";
+    wxLibrary *lib = wxTheLibraries.LoadLibrary("wxserial");
 
     if (!m_serialObj) {
-      wxLogError(_("Can't find the serialization object '%s' "
-                   "for the object '%s'."),
-                 obj_name.c_str(),
-                 GetClassInfo()->GetClassName());
-      return;
+        m_serialObj = (WXSERIAL(wxObject) *)lib->CreateObject( obj_name );
+
+        if (!m_serialObj) {
+            wxLogError(_("Can't find the serialization object '%s' "
+                        "for the object '%s'."),
+                    obj_name.c_str(),
+                    GetClassInfo()->GetClassName());
+            return;
+        }
+        m_serialObj->SetObject(this);
     }
-    m_serialObj->SetObject(this);
-  }
 
-  m_serialObj->LoadObject(stream);
+    m_serialObj->LoadObject(stream);
 }
 
 #endif // wxUSE_SERIAL
@@ -337,7 +337,7 @@ void wxObject::Ref(const wxObject& clone)
     }
 }
 
-void wxObject::UnRef(void)
+void wxObject::UnRef()
 {
     if (m_refData) {
         assert(m_refData->m_count > 0);
@@ -356,7 +356,7 @@ wxObjectRefData::wxObjectRefData(void) : m_count(1)
 {
 }
 
-wxObjectRefData::~wxObjectRefData(void)
+wxObjectRefData::~wxObjectRefData()
 {
 }
 
diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp
index c6fc8d44d9..9c88e7e7b9 100644
--- a/src/gtk/app.cpp
+++ b/src/gtk/app.cpp
@@ -8,7 +8,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
-#pragma implementation "app.h"
+    #pragma implementation "app.h"
 #endif
 
 #include "wx/app.h"
@@ -20,35 +20,24 @@
 #include "wx/font.h"
 #include "wx/settings.h"
 #include "wx/dialog.h"
+
 #if wxUSE_WX_RESOURCES
-#include "wx/resource.h"
+    #include "wx/resource.h"
 #endif
+
 #include "wx/module.h"
 #include "wx/image.h"
-#if wxUSE_THREADS
+
 #include "wx/thread.h"
-#endif
+
 #include "unistd.h"
 
-// many versions of Unices have this function, but it is not defined in system
-// headers - please add your system here if it is the case for your OS.
-// SunOS < 5.6 (i.e. Solaris < 2.6) and DG-UX are like this.
-#if (defined(__SUN__) && !defined(__SunOs_5_6) && \
-                         !defined(__SunOs_5_7) && !defined(__SUNPRO_CC)) || \
-     defined(__osf__)
-    extern "C"
-    {
-        void usleep(unsigned long usec);
-    };
-#endif // Unices without usleep()
+#include <glib.h>
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
 
-#include "glib.h"
-#include "gdk/gdk.h"
-#include "gtk/gtk.h"
 #include "wx/gtk/win_gtk.h"
 
-#include   <unistd.h> // usleep() on solaris
-
 //-----------------------------------------------------------------------------
 // global data
 //-----------------------------------------------------------------------------
@@ -160,14 +149,17 @@ END_EVENT_TABLE()
 
 gint wxapp_idle_callback( gpointer WXUNUSED(data) )
 {
-    if (wxTheApp) while (wxTheApp->ProcessIdle()) {}
-#if wxUSE_THREADS
+    if (wxTheApp)
+    {
+        while (wxTheApp->ProcessIdle())
+        {
+        }
+    }
+
     wxMutexGuiLeave();
-#endif
-    usleep(10000);
-#if wxUSE_THREADS
+    wxUsleep(10);
     wxMutexGuiEnter();
-#endif
+
     return TRUE;
 }
 
diff --git a/src/gtk/threadpsx.cpp b/src/gtk/threadpsx.cpp
index 79542d5e19..a5732e3aee 100644
--- a/src/gtk/threadpsx.cpp
+++ b/src/gtk/threadpsx.cpp
@@ -410,9 +410,7 @@ void wxThread::Yield()
 
 void wxThread::Sleep(unsigned long milliseconds)
 {
-    // FIXME how to test for nanosleep() availability?
-
-    usleep(milliseconds * 1000); // usleep(3) wants microseconds
+    wxUsleep(milliseconds);
 }
 
 // -----------------------------------------------------------------------------
diff --git a/src/gtk/utilsgtk.cpp b/src/gtk/utilsgtk.cpp
index a55812182a..a85d45a620 100644
--- a/src/gtk/utilsgtk.cpp
+++ b/src/gtk/utilsgtk.cpp
@@ -7,11 +7,6 @@
 // Licence:           wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-
-//#ifdef __GNUG__
-//#pragma implementation "utils.h"
-//#endif
-
 #include "wx/utils.h"
 #include "wx/string.h"
 
@@ -32,17 +27,30 @@
 #include <netdb.h>
 #include <signal.h>
 #include <fcntl.h>          // for O_WRONLY and friends
+#include <time.h>           // nanosleep() and/or usleep()
 
-#include "glib.h"
-#include "gdk/gdk.h"
-#include "gtk/gtk.h"
-#include "gtk/gtkfeatures.h"
-#include "gdk/gdkx.h"
+#include <glib.h>
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+#include <gtk/gtkfeatures.h>
+#include <gdk/gdkx.h>
 
 #ifdef __SVR4__
   #include <sys/systeminfo.h>
 #endif
 
+// many versions of Unices have this function, but it is not defined in system
+// headers - please add your system here if it is the case for your OS.
+// SunOS < 5.6 (i.e. Solaris < 2.6) and DG-UX are like this.
+#if (defined(__SUN__) && !defined(__SunOs_5_6) && \
+                         !defined(__SunOs_5_7) && !defined(__SUNPRO_CC)) || \
+     defined(__osf__)
+    extern "C"
+    {
+        void usleep(unsigned long usec);
+    };
+#endif // Unices without usleep()
+
 // many versions of Unices have this function, but it is not defined in system
 // headers - please add your system here if it is the case for your OS.
 // SunOS (and Solaris) and DG-UX are like this.
@@ -78,6 +86,30 @@ void wxSleep(int nSecs)
     sleep(nSecs);
 }
 
+void wxUsleep(unsigned long milliseconds)
+{
+#if defined(HAVE_NANOSLEEP)
+    timespec tmReq;
+    tmReq.tv_sec = milliseconds / 1000;
+    tmReq.tv_nsec = (milliseconds % 1000) * 1000 * 1000;
+
+    // we're not interested in remaining time nor in return value
+    (void)nanosleep(&tmReq, (timespec *)NULL);
+#elif defined(HAVE_USLEEP)
+    // uncomment this if you feel brave or if you are sure that your version
+    // of Solaris has a safe usleep() function but please notice that usleep()
+    // is known to lead to crashes in MT programs in Solaris 2.[67] and is not
+    // documented as MT-Safe
+    #if defined(__SUN__) && defined(wxUSE_THREADS)
+        #error "usleep() cannot be used in MT programs under Solaris."
+    #endif // Sun
+
+    usleep(milliseconds * 1000); // usleep(3) wants microseconds
+#else // !sleep function
+    #error "usleep() or nanosleep() function required for wxUsleep"
+#endif // sleep function
+}
+
 int wxKill(long pid, int sig)
 {
     return kill(pid, sig);
diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp
index c6fc8d44d9..9c88e7e7b9 100644
--- a/src/gtk1/app.cpp
+++ b/src/gtk1/app.cpp
@@ -8,7 +8,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
-#pragma implementation "app.h"
+    #pragma implementation "app.h"
 #endif
 
 #include "wx/app.h"
@@ -20,35 +20,24 @@
 #include "wx/font.h"
 #include "wx/settings.h"
 #include "wx/dialog.h"
+
 #if wxUSE_WX_RESOURCES
-#include "wx/resource.h"
+    #include "wx/resource.h"
 #endif
+
 #include "wx/module.h"
 #include "wx/image.h"
-#if wxUSE_THREADS
+
 #include "wx/thread.h"
-#endif
+
 #include "unistd.h"
 
-// many versions of Unices have this function, but it is not defined in system
-// headers - please add your system here if it is the case for your OS.
-// SunOS < 5.6 (i.e. Solaris < 2.6) and DG-UX are like this.
-#if (defined(__SUN__) && !defined(__SunOs_5_6) && \
-                         !defined(__SunOs_5_7) && !defined(__SUNPRO_CC)) || \
-     defined(__osf__)
-    extern "C"
-    {
-        void usleep(unsigned long usec);
-    };
-#endif // Unices without usleep()
+#include <glib.h>
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
 
-#include "glib.h"
-#include "gdk/gdk.h"
-#include "gtk/gtk.h"
 #include "wx/gtk/win_gtk.h"
 
-#include   <unistd.h> // usleep() on solaris
-
 //-----------------------------------------------------------------------------
 // global data
 //-----------------------------------------------------------------------------
@@ -160,14 +149,17 @@ END_EVENT_TABLE()
 
 gint wxapp_idle_callback( gpointer WXUNUSED(data) )
 {
-    if (wxTheApp) while (wxTheApp->ProcessIdle()) {}
-#if wxUSE_THREADS
+    if (wxTheApp)
+    {
+        while (wxTheApp->ProcessIdle())
+        {
+        }
+    }
+
     wxMutexGuiLeave();
-#endif
-    usleep(10000);
-#if wxUSE_THREADS
+    wxUsleep(10);
     wxMutexGuiEnter();
-#endif
+
     return TRUE;
 }
 
diff --git a/src/gtk1/threadpsx.cpp b/src/gtk1/threadpsx.cpp
index 79542d5e19..a5732e3aee 100644
--- a/src/gtk1/threadpsx.cpp
+++ b/src/gtk1/threadpsx.cpp
@@ -410,9 +410,7 @@ void wxThread::Yield()
 
 void wxThread::Sleep(unsigned long milliseconds)
 {
-    // FIXME how to test for nanosleep() availability?
-
-    usleep(milliseconds * 1000); // usleep(3) wants microseconds
+    wxUsleep(milliseconds);
 }
 
 // -----------------------------------------------------------------------------
diff --git a/src/gtk1/utilsgtk.cpp b/src/gtk1/utilsgtk.cpp
index a55812182a..a85d45a620 100644
--- a/src/gtk1/utilsgtk.cpp
+++ b/src/gtk1/utilsgtk.cpp
@@ -7,11 +7,6 @@
 // Licence:           wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-
-//#ifdef __GNUG__
-//#pragma implementation "utils.h"
-//#endif
-
 #include "wx/utils.h"
 #include "wx/string.h"
 
@@ -32,17 +27,30 @@
 #include <netdb.h>
 #include <signal.h>
 #include <fcntl.h>          // for O_WRONLY and friends
+#include <time.h>           // nanosleep() and/or usleep()
 
-#include "glib.h"
-#include "gdk/gdk.h"
-#include "gtk/gtk.h"
-#include "gtk/gtkfeatures.h"
-#include "gdk/gdkx.h"
+#include <glib.h>
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+#include <gtk/gtkfeatures.h>
+#include <gdk/gdkx.h>
 
 #ifdef __SVR4__
   #include <sys/systeminfo.h>
 #endif
 
+// many versions of Unices have this function, but it is not defined in system
+// headers - please add your system here if it is the case for your OS.
+// SunOS < 5.6 (i.e. Solaris < 2.6) and DG-UX are like this.
+#if (defined(__SUN__) && !defined(__SunOs_5_6) && \
+                         !defined(__SunOs_5_7) && !defined(__SUNPRO_CC)) || \
+     defined(__osf__)
+    extern "C"
+    {
+        void usleep(unsigned long usec);
+    };
+#endif // Unices without usleep()
+
 // many versions of Unices have this function, but it is not defined in system
 // headers - please add your system here if it is the case for your OS.
 // SunOS (and Solaris) and DG-UX are like this.
@@ -78,6 +86,30 @@ void wxSleep(int nSecs)
     sleep(nSecs);
 }
 
+void wxUsleep(unsigned long milliseconds)
+{
+#if defined(HAVE_NANOSLEEP)
+    timespec tmReq;
+    tmReq.tv_sec = milliseconds / 1000;
+    tmReq.tv_nsec = (milliseconds % 1000) * 1000 * 1000;
+
+    // we're not interested in remaining time nor in return value
+    (void)nanosleep(&tmReq, (timespec *)NULL);
+#elif defined(HAVE_USLEEP)
+    // uncomment this if you feel brave or if you are sure that your version
+    // of Solaris has a safe usleep() function but please notice that usleep()
+    // is known to lead to crashes in MT programs in Solaris 2.[67] and is not
+    // documented as MT-Safe
+    #if defined(__SUN__) && defined(wxUSE_THREADS)
+        #error "usleep() cannot be used in MT programs under Solaris."
+    #endif // Sun
+
+    usleep(milliseconds * 1000); // usleep(3) wants microseconds
+#else // !sleep function
+    #error "usleep() or nanosleep() function required for wxUsleep"
+#endif // sleep function
+}
+
 int wxKill(long pid, int sig)
 {
     return kill(pid, sig);
diff --git a/src/motif/app.cpp b/src/motif/app.cpp
index 7836a95070..0b8b01a03a 100644
--- a/src/motif/app.cpp
+++ b/src/motif/app.cpp
@@ -6,7 +6,7 @@
 // Created:     17/09/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
-// Licence:   	wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
@@ -70,19 +70,19 @@ bool wxApp::Initialize()
 #else
     wxBuffer = new char[BUFSIZ + 512];
 #endif
-    
+
     wxClassInfo::InitializeClasses();
-    
+
     wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING);
     wxTheColourDatabase->Initialize();
-    
+
     wxInitializeStockLists();
     wxInitializeStockObjects();
-    
+
 #if wxUSE_WX_RESOURCES
     wxInitializeResourceSystem();
 #endif
-    
+
     // For PostScript printing
 #if wxUSE_POSTSCRIPT
     /* Done using wxModule now
@@ -91,14 +91,14 @@ bool wxApp::Initialize()
     wxThePrintPaperDatabase->CreateDatabase();
     */
 #endif
-    
+
     wxBitmap::InitStandardHandlers();
-    
+
     wxWidgetHashTable = new wxHashTable(wxKEY_INTEGER);
-    
+
     wxModule::RegisterModules();
     if (!wxModule::InitializeModules()) return FALSE;
-    
+
     return TRUE;
 }
 
@@ -106,32 +106,32 @@ void wxApp::CleanUp()
 {
     delete wxWidgetHashTable;
     wxWidgetHashTable = NULL;
-    
+
     wxModule::CleanUpModules();
-    
+
 #if wxUSE_WX_RESOURCES
     wxCleanUpResourceSystem();
 #endif
-    
+
     wxDeleteStockObjects() ;
-    
+
     // Destroy all GDI lists, etc.
-    
+
     delete wxTheBrushList;
     wxTheBrushList = NULL;
-    
+
     delete wxThePenList;
     wxThePenList = NULL;
-    
+
     delete wxTheFontList;
     wxTheFontList = NULL;
-    
+
     delete wxTheBitmapList;
     wxTheBitmapList = NULL;
-    
+
     delete wxTheColourDatabase;
     wxTheColourDatabase = NULL;
-    
+
 #if wxUSE_POSTSCRIPT
     /* Done using wxModule now
     wxInitializePrintSetupData(FALSE);
@@ -139,17 +139,17 @@ void wxApp::CleanUp()
     wxThePrintPaperDatabase = NULL;
     */
 #endif
-    
+
     wxBitmap::CleanUpHandlers();
-    
+
     delete[] wxBuffer;
     wxBuffer = NULL;
-    
+
     wxClassInfo::CleanUpClasses();
-    
+
     delete wxTheApp;
     wxTheApp = NULL;
-    
+
 #if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
     // At this point we want to check if there are any memory
     // blocks that aren't part of the wxDebugContext itself,
@@ -162,7 +162,7 @@ void wxApp::CleanUp()
         wxDebugContext::PrintStatistics();
     }
 #endif
-    
+
     // do it as the very last thing because everything else can log messages
     wxLog::DontCreateOnDemand();
     // do it as the very last thing because everything else can log messages
@@ -180,10 +180,10 @@ int wxEntry( int argc, char *argv[] )
     // checked, but this is a reasonable compromise.
     wxDebugContext::SetCheckpoint();
 #endif
-    
+
     if (!wxApp::Initialize())
         return FALSE;
-    
+
     if (!wxTheApp)
     {
         if (!wxApp::GetInitializerFunction())
@@ -191,55 +191,55 @@ int wxEntry( int argc, char *argv[] )
             printf( "wxWindows error: No initializer - use IMPLEMENT_APP macro.\n" );
             return 0;
         };
-        
+
         wxTheApp = (wxApp*) (* wxApp::GetInitializerFunction()) ();
     };
-    
+
     if (!wxTheApp)
     {
         printf( "wxWindows error: wxTheApp == NULL\n" );
         return 0;
     };
-    
+
     wxTheApp->SetClassName(wxFileNameFromPath(argv[0]));
     wxTheApp->SetAppName(wxFileNameFromPath(argv[0]));
-    
+
     wxTheApp->argc = argc;
     wxTheApp->argv = argv;
-    
+
     // GUI-specific initialization, such as creating an app context.
     wxTheApp->OnInitGui();
-    
+
     // Here frames insert themselves automatically
     // into wxTopLevelWindows by getting created
     // in OnInit().
-    
+
     int retValue = 0;
     if (wxTheApp->OnInit())
     {
         if (wxTheApp->Initialized()) retValue = wxTheApp->OnRun();
     }
-    
+
     // flush the logged messages if any
     wxLog *pLog = wxLog::GetActiveTarget();
     if ( pLog != NULL && pLog->HasPendingMessages() )
         pLog->Flush();
-    
+
     delete wxLog::SetActiveTarget(new wxLogStderr); // So dialog boxes aren't used
     // for further messages
-    
+
     if (wxTheApp->GetTopWindow())
     {
         delete wxTheApp->GetTopWindow();
         wxTheApp->SetTopWindow(NULL);
     }
-    
+
     wxTheApp->DeletePendingObjects();
-    
+
     wxTheApp->OnExit();
-    
+
     wxApp::CleanUp();
-    
+
     return retValue;
 };
 
@@ -258,7 +258,7 @@ wxApp::wxApp()
     m_printMode = wxPRINT_POSTSCRIPT;
     m_exitOnFrameDelete = TRUE;
     m_auto3D = TRUE;
-    
+
     m_mainColormap = (WXColormap) NULL;
     m_appContext = (WXAppContext) NULL;
     m_topLevelWidget = (WXWidget) NULL;
@@ -277,42 +277,41 @@ bool wxApp::Initialized()
 int wxApp::MainLoop()
 {
     m_keepGoing = TRUE;
-    
+
     /*
     * Sit around forever waiting to process X-events. Property Change
     * event are handled special, because they have to refer to
     * the root window rather than to a widget. therefore we can't
     * use an Xt-eventhandler.
     */
-    
+
     XSelectInput(XtDisplay((Widget) wxTheApp->GetTopLevelWidget()),
         XDefaultRootWindow(XtDisplay((Widget) wxTheApp->GetTopLevelWidget())),
         PropertyChangeMask);
-    
+
     XEvent event;
-    
+
     // Use this flag to allow breaking the loop via wxApp::ExitMainLoop()
     while (m_keepGoing)
     {
         XtAppNextEvent( (XtAppContext) wxTheApp->GetAppContext(), &event);
-        
+
         ProcessXEvent((WXEvent*) & event);
-        
+
         if (XtAppPending( (XtAppContext) wxTheApp->GetAppContext() ) == 0)
         {
             if (!ProcessIdle())
-            { 
-                // TODO: Robert, what's this for?
-#if wxUSE_THREADS
+            {
+                // leave the main loop to give other threads a chance to
+                // perform their GUI work
                 wxMutexGuiLeave();
-                usleep(20);  
+                wxUsleep(20);
                 wxMutexGuiEnter();
-#endif
             }
         }
-        
+
     }
-    
+
     return 0;
 }
 
@@ -320,7 +319,7 @@ int wxApp::MainLoop()
 void wxApp::ProcessXEvent(WXEvent* _event)
 {
     XEvent* event = (XEvent*) _event;
-    
+
     if ((event->type == KeyPress) && CheckForAccelerator(_event))
     {
         // Do nothing! We intercepted and processed the event as an accelerator.
@@ -337,18 +336,18 @@ void wxApp::ProcessXEvent(WXEvent* _event)
     * If resize event, don't resize until the last resize event for this
     * window is recieved. Prevents flicker as windows are resized.
         */
-        
+
         Display *disp = XtDisplay((Widget) wxTheApp->GetTopLevelWidget());
         Window win = event->xany.window;
         XEvent report;
-        
+
         //  to avoid flicker
         report = * event;
         while( XCheckTypedWindowEvent (disp, win, ResizeRequest, &report));
-        
+
         // TODO: when implementing refresh optimization, we can use
         // XtAddExposureToRegion to expand the window's paint region.
-        
+
         XtDispatchEvent(event);
     }
     else
@@ -363,7 +362,7 @@ bool wxApp::ProcessIdle()
     wxIdleEvent event;
     event.SetEventObject(this);
     ProcessEvent(event);
-    
+
     return event.MoreRequested();
 }
 
@@ -376,7 +375,7 @@ void wxApp::ExitMainLoop()
 bool wxApp::Pending()
 {
     XFlush(XtDisplay( (Widget) wxTheApp->GetTopLevelWidget() ));
-    
+
     // Fix by Doug from STI, to prevent a stall if non-X event
     // is found.
     return ((XtAppPending( (XtAppContext) GetAppContext() ) & XtIMXEvent) != 0) ;
@@ -386,7 +385,7 @@ bool wxApp::Pending()
 void wxApp::Dispatch()
 {
     //    XtAppProcessEvent( (XtAppContext) wxTheApp->GetAppContext(), XtIMAll);
-    
+
     XEvent event;
     XtAppNextEvent((XtAppContext) GetAppContext(), &event);
     ProcessXEvent((WXEvent*) & event);
@@ -403,27 +402,27 @@ void wxApp::HandlePropertyChange(WXEvent *event)
 void wxApp::OnIdle(wxIdleEvent& event)
 {
     static bool inOnIdle = FALSE;
-    
+
     // Avoid recursion (via ProcessEvent default case)
     if (inOnIdle)
         return;
-    
+
     inOnIdle = TRUE;
-    
+
     // 'Garbage' collection of windows deleted with Close().
     DeletePendingObjects();
-    
+
     // flush the logged messages if any
     wxLog *pLog = wxLog::GetActiveTarget();
     if ( pLog != NULL && pLog->HasPendingMessages() )
         pLog->Flush();
-    
+
     // Send OnIdle events to all windows
     bool needMore = SendIdleEvents();
-    
+
     if (needMore)
         event.RequestMore(TRUE);
-    
+
     inOnIdle = FALSE;
 }
 
@@ -437,7 +436,7 @@ bool wxApp::SendIdleEvents()
         wxWindow* win = (wxWindow*) node->Data();
         if (SendIdleEvents(win))
             needMore = TRUE;
-        
+
         node = node->Next();
     }
     return needMore;
@@ -447,21 +446,21 @@ bool wxApp::SendIdleEvents()
 bool wxApp::SendIdleEvents(wxWindow* win)
 {
     bool needMore = FALSE;
-    
+
     wxIdleEvent event;
     event.SetEventObject(win);
     win->ProcessEvent(event);
-    
+
     if (event.MoreRequested())
         needMore = TRUE;
-    
+
     wxNode* node = win->GetChildren().First();
     while (node)
     {
         wxWindow* win = (wxWindow*) node->Data();
         if (SendIdleEvents(win))
             needMore = TRUE;
-        
+
         node = node->Next();
     }
     return needMore ;
@@ -473,12 +472,12 @@ void wxApp::DeletePendingObjects()
     while (node)
     {
         wxObject *obj = (wxObject *)node->Data();
-        
+
         delete obj;
-        
+
         if (wxPendingDelete.Member(obj))
             delete node;
-        
+
         // Deleting one object may have deleted other pending
         // objects, so start from beginning of list again.
         node = wxPendingDelete.First();
@@ -517,20 +516,20 @@ bool wxApp::OnInitGui()
         exit(-1);
     }
     m_initialDisplay = (WXDisplay*) dpy;
-    
+
     wxTheApp->m_topLevelWidget = (WXWidget) XtAppCreateShell((String)NULL, (const char*) wxTheApp->GetClassName(),
         applicationShellWidgetClass,dpy,
         NULL,0) ;
-    
+
     // Add general resize proc
     XtActionsRec rec;
     rec.string = "resize";
     rec.proc = (XtActionProc)wxWidgetResizeProc;
     XtAppAddActions((XtAppContext) wxTheApp->m_appContext, &rec, 1);
-    
+
     GetMainColormap(dpy);
     m_maxRequestSize = XMaxRequestSize((Display*) dpy);
-    
+
     return TRUE;
 }
 
@@ -541,12 +540,12 @@ WXColormap wxApp::GetMainColormap(WXDisplay* display)
 
     int defaultScreen = DefaultScreen((Display*) display);
     Screen* screen = XScreenOfDisplay((Display*) display, defaultScreen);
-    
+
     Colormap c = DefaultColormapOfScreen(screen);
-    
+
     if (!m_mainColormap)
         m_mainColormap = (WXColormap) c;
-    
+
     return (WXColormap) c;
 }
 
@@ -560,17 +559,17 @@ bool wxApp::CheckForAccelerator(WXEvent* event)
         // TODO: should get display for the window, not the current display
         Widget widget = XtWindowToWidget((Display*) wxGetDisplay(), xEvent->xany.window);
         wxWindow* win = NULL;
-        
+
         // Find the first wxWindow that corresponds to this event window
         while (widget && !(win = wxGetWindowFromTable(widget)))
             widget = XtParent(widget);
-        
+
         if (!widget || !win)
             return FALSE;
-        
+
         wxKeyEvent keyEvent(wxEVT_CHAR);
         wxTranslateKeyEvent(keyEvent, win, (Widget) 0, xEvent);
-        
+
         // Now we have a wxKeyEvent and we have a wxWindow.
         // Go up the hierarchy until we find a matching accelerator,
         // or we get to the top.
@@ -590,7 +589,7 @@ void wxExit()
     int retValue = 0;
     if (wxTheApp)
         retValue = wxTheApp->OnExit();
-    
+
     wxApp::CleanUp();
     /*
     * Exit in some platform-specific way. Not recommended that the app calls this:
diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp
index d2d584162b..1433988261 100644
--- a/src/msw/utils.cpp
+++ b/src/msw/utils.cpp
@@ -299,6 +299,11 @@ class wxSleepTimer: public wxTimer
 
 static wxTimer *wxTheSleepTimer = NULL;
 
+void wxUsleep(unsigned long milliseconds)
+{
+    ::Sleep(milliseconds);
+}
+
 void wxSleep(int nSecs)
 {
 #if 0 // WIN32 hangs app
-- 
2.50.0

