Tcl Source Code

Check-in [a790f23b77]
Login

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

Overview
Comment:3530533 Centralize #include <pthread.h> in the tclUnixPort.h header so that old unix systems that need inclusion in all compilation units are supported. Update autogoo for gettimeofday(). Thanks Joe English.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a790f23b77aec343ff78690d800c512d06b1a63f
User & Date: dgp 2012-06-08 13:25:24
Context
2012-06-11
17:49
3532959 Make sure the lifetime management of entries in the linePBodyPtr hash table can tolerate eit... check-in: bfddfa54a6 user: dgp tags: trunk
09:34
new attempt, with only those parts of frq-3527238 which don't introduce new command options, so don'... check-in: 28ef7b1b66 user: jan.nijtmans tags: frq-3527238
2012-06-09
23:18
merge trunk check-in: 22783de97e user: dkf tags: tip-400-impl
2012-06-08
13:25
3530533 Centralize #include <pthread.h> in the tclUnixPort.h header so that old unix systems that ne... check-in: a790f23b77 user: dgp tags: trunk
13:14
Update autogoo for gettimeofday(). Thanks Joe English. check-in: a5996386b3 user: dgp tags: core-8-5-branch
08:07
Revise the "null data" check: null strings are possible, but empty binary arrays are not check-in: 146dc6a0b5 user: jan.nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.











1
2
3
4
5
6
7










2012-06-08  Jan Nijtmans  <[email protected]>

	* win/tclWinDde.c:    Revise the "null data" check: null strings are
	possible, but empty binary arrays are not.
	* tests/winDde.test:  Add test-case (winDde-9.4) for transferring
	null-strings with dde. Convert tests to tcltest-2 syntax.

>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2012-06-08  Don Porter  <[email protected]>

	* unix/configure.in:	Update autogoo for gettimeofday().
	* unix/tclUnixPort.h:	Thanks Joe English.
	* unix/configure:	autoconf 2.13

	* unix/tclUnixPort.h:	[Bug 3530533] Centralize #include <pthread.h>
	* unix/tclUnixThrd.c:	in the tclUnixPort.h header so that old unix
	systems that need inclusion in all compilation units are supported.

2012-06-08  Jan Nijtmans  <[email protected]>

	* win/tclWinDde.c:    Revise the "null data" check: null strings are
	possible, but empty binary arrays are not.
	* tests/winDde.test:  Add test-case (winDde-9.4) for transferring
	null-strings with dde. Convert tests to tcltest-2 syntax.

Changes to unix/configure.

16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
    USE_COMPAT=1
fi

#--------------------------------------------------------------------
#	The code below deals with several issues related to gettimeofday:
#	1. Some systems don't provide a gettimeofday function at all
#	   (set NO_GETTOD if this is the case).
#	2. SGI systems don't use the BSD form of the gettimeofday function,
#	   but they have a BSDgettimeofday function that can be used instead.
#	3. See if gettimeofday is declared in the <sys/time.h> header file.
#	   if not, set the GETTOD_NOT_DECLARED flag so that tclPort.h can
#	   declare it.
#--------------------------------------------------------------------

echo "$as_me:$LINENO: checking for BSDgettimeofday" >&5
echo $ECHO_N "checking for BSDgettimeofday... $ECHO_C" >&6
if test "${ac_cv_func_BSDgettimeofday+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define BSDgettimeofday to an innocuous variant, in case <limits.h> declares BSDgettimeofday.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define BSDgettimeofday innocuous_BSDgettimeofday

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char BSDgettimeofday (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef BSDgettimeofday

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char BSDgettimeofday ();
/* 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_BSDgettimeofday) || defined (__stub___BSDgettimeofday)
choke me
#else
char (*f) () = BSDgettimeofday;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != BSDgettimeofday;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_BSDgettimeofday=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_func_BSDgettimeofday=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_BSDgettimeofday" >&5
echo "${ECHO_T}$ac_cv_func_BSDgettimeofday" >&6
if test $ac_cv_func_BSDgettimeofday = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_BSDGETTIMEOFDAY 1
_ACEOF

else

    echo "$as_me:$LINENO: checking for gettimeofday" >&5
echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
if test "${ac_cv_func_gettimeofday+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF







<
<
|




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|







16687
16688
16689
16690
16691
16692
16693


16694
16695
16696
16697
16698


































































































16699
16700
16701
16702
16703
16704
16705
16706
    USE_COMPAT=1
fi

#--------------------------------------------------------------------
#	The code below deals with several issues related to gettimeofday:
#	1. Some systems don't provide a gettimeofday function at all
#	   (set NO_GETTOD if this is the case).


#	2. See if gettimeofday is declared in the <sys/time.h> header file.
#	   if not, set the GETTOD_NOT_DECLARED flag so that tclPort.h can
#	   declare it.
#--------------------------------------------------------------------



































































































echo "$as_me:$LINENO: checking for gettimeofday" >&5
echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
if test "${ac_cv_func_gettimeofday+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
16885
16886
16887
16888
16889
16890
16891

16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_gettimeofday" >&5
echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
if test $ac_cv_func_gettimeofday = yes; then
  :
else


cat >>confdefs.h <<\_ACEOF
#define NO_GETTOD 1
_ACEOF

fi


fi

echo "$as_me:$LINENO: checking for gettimeofday declaration" >&5
echo $ECHO_N "checking for gettimeofday declaration... $ECHO_C" >&6
if test "${tcl_cv_grep_gettimeofday+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6







>





<
<







16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797


16798
16799
16800
16801
16802
16803
16804
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_gettimeofday" >&5
echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
if test $ac_cv_func_gettimeofday = yes; then
  :
else


cat >>confdefs.h <<\_ACEOF
#define NO_GETTOD 1
_ACEOF




fi

echo "$as_me:$LINENO: checking for gettimeofday declaration" >&5
echo $ECHO_N "checking for gettimeofday declaration... $ECHO_C" >&6
if test "${tcl_cv_grep_gettimeofday+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6

Changes to unix/configure.in.

467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
    USE_COMPAT=1
fi

#--------------------------------------------------------------------
#	The code below deals with several issues related to gettimeofday:
#	1. Some systems don't provide a gettimeofday function at all
#	   (set NO_GETTOD if this is the case).
#	2. SGI systems don't use the BSD form of the gettimeofday function,
#	   but they have a BSDgettimeofday function that can be used instead.
#	3. See if gettimeofday is declared in the <sys/time.h> header file.
#	   if not, set the GETTOD_NOT_DECLARED flag so that tclPort.h can
#	   declare it.
#--------------------------------------------------------------------

AC_CHECK_FUNC(BSDgettimeofday,
    [AC_DEFINE(HAVE_BSDGETTIMEOFDAY, 1, [Do we have BSDgettimeofday()?])], [
    AC_CHECK_FUNC(gettimeofday, , [AC_DEFINE(NO_GETTOD, 1, [Do we have gettimeofday()?])])
])
AC_CACHE_CHECK([for gettimeofday declaration], tcl_cv_grep_gettimeofday, [
    AC_EGREP_HEADER(gettimeofday, sys/time.h,
	tcl_cv_grep_gettimeofday=present, tcl_cv_grep_gettimeofday=missing)])
if test $tcl_cv_grep_gettimeofday = missing ; then
    AC_DEFINE(GETTOD_NOT_DECLARED, 1, [Is gettimeofday() actually declared in <sys/time.h>?])
fi







<
<
|




|
<
|







467
468
469
470
471
472
473


474
475
476
477
478
479

480
481
482
483
484
485
486
487
    USE_COMPAT=1
fi

#--------------------------------------------------------------------
#	The code below deals with several issues related to gettimeofday:
#	1. Some systems don't provide a gettimeofday function at all
#	   (set NO_GETTOD if this is the case).


#	2. See if gettimeofday is declared in the <sys/time.h> header file.
#	   if not, set the GETTOD_NOT_DECLARED flag so that tclPort.h can
#	   declare it.
#--------------------------------------------------------------------

AC_CHECK_FUNC(gettimeofday,[],[

    AC_DEFINE(NO_GETTOD, 1, [Do we have gettimeofday()?])
])
AC_CACHE_CHECK([for gettimeofday declaration], tcl_cv_grep_gettimeofday, [
    AC_EGREP_HEADER(gettimeofday, sys/time.h,
	tcl_cv_grep_gettimeofday=present, tcl_cv_grep_gettimeofday=missing)])
if test $tcl_cv_grep_gettimeofday = missing ; then
    AC_DEFINE(GETTOD_NOT_DECLARED, 1, [Is gettimeofday() actually declared in <sys/time.h>?])
fi

Changes to unix/tclUnixPort.h.

714
715
716
717
718
719
720

721
722
723
724
725
726
727
 * The following macros and declaration wrap the C runtime library functions.
 *---------------------------------------------------------------------------
 */

#define TclpExit	exit

#ifdef TCL_THREADS

#   undef inet_ntoa
#   define inet_ntoa(x)	TclpInetNtoa(x)
#endif /* TCL_THREADS */

/* FIXME - Hyper-enormous platform assumption! */
#ifndef AF_INET6
#   define AF_INET6	10







>







714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
 * The following macros and declaration wrap the C runtime library functions.
 *---------------------------------------------------------------------------
 */

#define TclpExit	exit

#ifdef TCL_THREADS
#   include <pthread.h>
#   undef inet_ntoa
#   define inet_ntoa(x)	TclpInetNtoa(x)
#endif /* TCL_THREADS */

/* FIXME - Hyper-enormous platform assumption! */
#ifndef AF_INET6
#   define AF_INET6	10

Changes to unix/tclUnixThrd.c.

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#include "tclInt.h"

#ifdef TCL_THREADS

#include <pthread.h>

typedef struct ThreadSpecificData {
    char nabuf[16];
} ThreadSpecificData;

static Tcl_ThreadDataKey dataKey;

/*







<
<







11
12
13
14
15
16
17


18
19
20
21
22
23
24
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#include "tclInt.h"

#ifdef TCL_THREADS



typedef struct ThreadSpecificData {
    char nabuf[16];
} ThreadSpecificData;

static Tcl_ThreadDataKey dataKey;

/*