From 1b53ef3bbd2bd4139a0fbbeaa493a2d4562b9825 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 26 Jun 2023 09:52:00 +0000 Subject: Remove compat/stdint.h and compat/stdlib.h: All C-compilers nowadays have it. --- compat/stdint.h | 919 ------------------------------------------- compat/stdlib.h | 39 -- generic/tcl.h | 4 +- generic/tclInt.h | 7 +- generic/tclTomMath.h | 8 +- libtommath/tommath.h | 5 +- libtommath/tommath_private.h | 8 +- unix/Makefile.in | 2 +- unix/tcl.m4 | 2 +- unix/tclConfig.h.in | 3 + unix/tclUnixPort.h | 5 - win/Makefile.in | 2 +- win/configure | 47 --- win/tcl.m4 | 24 -- win/tclWinPort.h | 6 - 15 files changed, 13 insertions(+), 1068 deletions(-) delete mode 100644 compat/stdint.h delete mode 100644 compat/stdlib.h diff --git a/compat/stdint.h b/compat/stdint.h deleted file mode 100644 index 88383b0..0000000 --- a/compat/stdint.h +++ /dev/null @@ -1,919 +0,0 @@ -/* A portable stdint.h - **************************************************************************** - * BSD License: - **************************************************************************** - * - * Copyright (c) 2005-2016 Paul Hsieh - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - **************************************************************************** - * - * Version 0.1.16.0 - * - * The ANSI C standard committee, for the C99 standard, specified the - * inclusion of a new standard include file called stdint.h. This is - * a very useful and long desired include file which contains several - * very precise definitions for integer scalar types that is critically - * important for making several classes of applications portable - * including cryptography, hashing, variable length integer libraries - * and so on. But for most developers its likely useful just for - * programming sanity. - * - * The problem is that some compiler vendors chose to ignore the C99 - * standard and some older compilers have no opportunity to be updated. - * Because of this situation, simply including stdint.h in your code - * makes it unportable. - * - * So that's what this file is all about. It's an attempt to build a - * single universal include file that works on as many platforms as - * possible to deliver what stdint.h is supposed to. Even compilers - * that already come with stdint.h can use this file instead without - * any loss of functionality. A few things that should be noted about - * this file: - * - * 1) It is not guaranteed to be portable and/or present an identical - * interface on all platforms. The extreme variability of the - * ANSI C standard makes this an impossibility right from the - * very get go. Its really only meant to be useful for the vast - * majority of platforms that possess the capability of - * implementing usefully and precisely defined, standard sized - * integer scalars. Systems which are not intrinsically 2s - * complement may produce invalid constants. - * - * 2) There is an unavoidable use of non-reserved symbols. - * - * 3) Other standard include files are invoked. - * - * 4) This file may come in conflict with future platforms that do - * include stdint.h. The hope is that one or the other can be - * used with no real difference. - * - * 5) In the current version, if your platform can't represent - * int32_t, int16_t and int8_t, it just dumps out with a compiler - * error. - * - * 6) 64 bit integers may or may not be defined. Test for their - * presence with the test: #ifdef INT64_MAX or #ifdef UINT64_MAX. - * Note that this is different from the C99 specification which - * requires the existence of 64 bit support in the compiler. If - * this is not defined for your platform, yet it is capable of - * dealing with 64 bits then it is because this file has not yet - * been extended to cover all of your system's capabilities. - * - * 7) (u)intptr_t may or may not be defined. Test for its presence - * with the test: #ifdef PTRDIFF_MAX. If this is not defined - * for your platform, then it is because this file has not yet - * been extended to cover all of your system's capabilities, not - * because its optional. - * - * 8) The following might not been defined even if your platform is - * capable of defining it: - * - * WCHAR_MIN - * WCHAR_MAX - * (u)int64_t - * PTRDIFF_MIN - * PTRDIFF_MAX - * (u)intptr_t - * - * 9) The following have not been defined: - * - * WINT_MIN - * WINT_MAX - * - * 10) The criteria for defining (u)int_least(*)_t isn't clear, - * except for systems which don't have a type that precisely - * defined 8, 16, or 32 bit types (which this include file does - * not support anyways). Default definitions have been given. - * - * 11) The criteria for defining (u)int_fast(*)_t isn't something I - * would trust to any particular compiler vendor or the ANSI C - * committee. It is well known that "compatible systems" are - * commonly created that have very different performance - * characteristics from the systems they are compatible with, - * especially those whose vendors make both the compiler and the - * system. Default definitions have been given, but its strongly - * recommended that users never use these definitions for any - * reason (they do *NOT* deliver any serious guarantee of - * improved performance -- not in this file, nor any vendor's - * stdint.h). - * - * 12) The following macros: - * - * PRINTF_INTMAX_MODIFIER - * PRINTF_INT64_MODIFIER - * PRINTF_INT32_MODIFIER - * PRINTF_INT16_MODIFIER - * PRINTF_LEAST64_MODIFIER - * PRINTF_LEAST32_MODIFIER - * PRINTF_LEAST16_MODIFIER - * PRINTF_INTPTR_MODIFIER - * - * are strings which have been defined as the modifiers required - * for the "d", "u" and "x" printf formats to correctly output - * (u)intmax_t, (u)int64_t, (u)int32_t, (u)int16_t, (u)least64_t, - * (u)least32_t, (u)least16_t and (u)intptr_t types respectively. - * PRINTF_INTPTR_MODIFIER is not defined for some systems which - * provide their own stdint.h. PRINTF_INT64_MODIFIER is not - * defined if INT64_MAX is not defined. These are an extension - * beyond what C99 specifies must be in stdint.h. - * - * In addition, the following macros are defined: - * - * PRINTF_INTMAX_HEX_WIDTH - * PRINTF_INT64_HEX_WIDTH - * PRINTF_INT32_HEX_WIDTH - * PRINTF_INT16_HEX_WIDTH - * PRINTF_INT8_HEX_WIDTH - * PRINTF_INTMAX_DEC_WIDTH - * PRINTF_INT64_DEC_WIDTH - * PRINTF_INT32_DEC_WIDTH - * PRINTF_INT16_DEC_WIDTH - * PRINTF_UINT8_DEC_WIDTH - * PRINTF_UINTMAX_DEC_WIDTH - * PRINTF_UINT64_DEC_WIDTH - * PRINTF_UINT32_DEC_WIDTH - * PRINTF_UINT16_DEC_WIDTH - * PRINTF_UINT8_DEC_WIDTH - * - * Which specifies the maximum number of characters required to - * print the number of that type in either hexadecimal or decimal. - * These are an extension beyond what C99 specifies must be in - * stdint.h. - * - * Compilers tested (all with 0 warnings at their highest respective - * settings): Borland Turbo C 2.0, WATCOM C/C++ 11.0 (16 bits and 32 - * bits), Microsoft Visual C++ 6.0 (32 bit), Microsoft Visual Studio - * .net (VC7), Intel C++ 4.0, GNU gcc v3.3.3 - * - * This file should be considered a work in progress. Suggestions for - * improvements, especially those which increase coverage are strongly - * encouraged. - * - * Acknowledgements - * - * The following people have made significant contributions to the - * development and testing of this file: - * - * Chris Howie - * John Steele Scott - * Dave Thorup - * John Dill - * Florian Wobbe - * Christopher Sean Morrison - * Mikkel Fahnoe Jorgensen - * - */ - -#include -#include -#include - -/* - * For gcc with _STDINT_H, fill in the PRINTF_INT*_MODIFIER macros, and - * do nothing else. On the Mac OS X version of gcc this is _STDINT_H_. - */ - -#if ((defined(__SUNPRO_C) && __SUNPRO_C >= 0x570) || (defined(_MSC_VER) && _MSC_VER >= 1600) || (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (__GNUC__ > 3 || defined(_STDINT_H) || defined(_STDINT_H_) || defined (__UINT_FAST64_TYPE__)) )) && !defined (_PSTDINT_H_INCLUDED) -#include -#define _PSTDINT_H_INCLUDED -# if defined(__GNUC__) && (defined(__x86_64__) || defined(__ppc64__)) && !(defined(__APPLE__) && defined(__MACH__)) -# ifndef PRINTF_INT64_MODIFIER -# define PRINTF_INT64_MODIFIER "l" -# endif -# ifndef PRINTF_INT32_MODIFIER -# define PRINTF_INT32_MODIFIER "" -# endif -# else -# ifndef PRINTF_INT64_MODIFIER -# define PRINTF_INT64_MODIFIER "ll" -# endif -# ifndef PRINTF_INT32_MODIFIER -# if (UINT_MAX == UINT32_MAX) -# define PRINTF_INT32_MODIFIER "" -# else -# define PRINTF_INT32_MODIFIER "l" -# endif -# endif -# endif -# ifndef PRINTF_INT16_MODIFIER -# define PRINTF_INT16_MODIFIER "h" -# endif -# ifndef PRINTF_INTMAX_MODIFIER -# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER -# endif -# ifndef PRINTF_INT64_HEX_WIDTH -# define PRINTF_INT64_HEX_WIDTH "16" -# endif -# ifndef PRINTF_UINT64_HEX_WIDTH -# define PRINTF_UINT64_HEX_WIDTH "16" -# endif -# ifndef PRINTF_INT32_HEX_WIDTH -# define PRINTF_INT32_HEX_WIDTH "8" -# endif -# ifndef PRINTF_UINT32_HEX_WIDTH -# define PRINTF_UINT32_HEX_WIDTH "8" -# endif -# ifndef PRINTF_INT16_HEX_WIDTH -# define PRINTF_INT16_HEX_WIDTH "4" -# endif -# ifndef PRINTF_UINT16_HEX_WIDTH -# define PRINTF_UINT16_HEX_WIDTH "4" -# endif -# ifndef PRINTF_INT8_HEX_WIDTH -# define PRINTF_INT8_HEX_WIDTH "2" -# endif -# ifndef PRINTF_UINT8_HEX_WIDTH -# define PRINTF_UINT8_HEX_WIDTH "2" -# endif -# ifndef PRINTF_INT64_DEC_WIDTH -# define PRINTF_INT64_DEC_WIDTH "19" -# endif -# ifndef PRINTF_UINT64_DEC_WIDTH -# define PRINTF_UINT64_DEC_WIDTH "20" -# endif -# ifndef PRINTF_INT32_DEC_WIDTH -# define PRINTF_INT32_DEC_WIDTH "10" -# endif -# ifndef PRINTF_UINT32_DEC_WIDTH -# define PRINTF_UINT32_DEC_WIDTH "10" -# endif -# ifndef PRINTF_INT16_DEC_WIDTH -# define PRINTF_INT16_DEC_WIDTH "5" -# endif -# ifndef PRINTF_UINT16_DEC_WIDTH -# define PRINTF_UINT16_DEC_WIDTH "5" -# endif -# ifndef PRINTF_INT8_DEC_WIDTH -# define PRINTF_INT8_DEC_WIDTH "3" -# endif -# ifndef PRINTF_UINT8_DEC_WIDTH -# define PRINTF_UINT8_DEC_WIDTH "3" -# endif -# ifndef PRINTF_INTMAX_HEX_WIDTH -# define PRINTF_INTMAX_HEX_WIDTH PRINTF_UINT64_HEX_WIDTH -# endif -# ifndef PRINTF_UINTMAX_HEX_WIDTH -# define PRINTF_UINTMAX_HEX_WIDTH PRINTF_UINT64_HEX_WIDTH -# endif -# ifndef PRINTF_INTMAX_DEC_WIDTH -# define PRINTF_INTMAX_DEC_WIDTH PRINTF_UINT64_DEC_WIDTH -# endif -# ifndef PRINTF_UINTMAX_DEC_WIDTH -# define PRINTF_UINTMAX_DEC_WIDTH PRINTF_UINT64_DEC_WIDTH -# endif - -/* - * Something really weird is going on with Open Watcom. Just pull some of - * these duplicated definitions from Open Watcom's stdint.h file for now. - */ - -# if defined (__WATCOMC__) && __WATCOMC__ >= 1250 -# if !defined (INT64_C) -# define INT64_C(x) (x + (INT64_MAX - INT64_MAX)) -# endif -# if !defined (UINT64_C) -# define UINT64_C(x) (x + (UINT64_MAX - UINT64_MAX)) -# endif -# if !defined (INT32_C) -# define INT32_C(x) (x + (INT32_MAX - INT32_MAX)) -# endif -# if !defined (UINT32_C) -# define UINT32_C(x) (x + (UINT32_MAX - UINT32_MAX)) -# endif -# if !defined (INT16_C) -# define INT16_C(x) (x) -# endif -# if !defined (UINT16_C) -# define UINT16_C(x) (x) -# endif -# if !defined (INT8_C) -# define INT8_C(x) (x) -# endif -# if !defined (UINT8_C) -# define UINT8_C(x) (x) -# endif -# if !defined (UINT64_MAX) -# define UINT64_MAX 18446744073709551615ULL -# endif -# if !defined (INT64_MAX) -# define INT64_MAX 9223372036854775807LL -# endif -# if !defined (UINT32_MAX) -# define UINT32_MAX 4294967295UL -# endif -# if !defined (INT32_MAX) -# define INT32_MAX 2147483647L -# endif -# if !defined (INTMAX_MAX) -# define INTMAX_MAX INT64_MAX -# endif -# if !defined (INTMAX_MIN) -# define INTMAX_MIN INT64_MIN -# endif -# endif -#endif - -/* - * I have no idea what is the truly correct thing to do on older Solaris. - * From some online discussions, this seems to be what is being - * recommended. For people who actually are developing on older Solaris, - * what I would like to know is, does this define all of the relevant - * macros of a complete stdint.h? Remember, in pstdint.h 64 bit is - * considered optional. - */ - -#if (defined(__SUNPRO_C) && __SUNPRO_C >= 0x420) && !defined(_PSTDINT_H_INCLUDED) -#include -#define _PSTDINT_H_INCLUDED -#endif - -#ifndef _PSTDINT_H_INCLUDED -#define _PSTDINT_H_INCLUDED - -#ifndef SIZE_MAX -# define SIZE_MAX ((size_t)-1) -#endif - -/* - * Deduce the type assignments from limits.h under the assumption that - * integer sizes in bits are powers of 2, and follow the ANSI - * definitions. - */ - -#ifndef UINT8_MAX -# define UINT8_MAX 0xff -#endif -#if !defined(uint8_t) && !defined(_UINT8_T) && !defined(vxWorks) -# if (UCHAR_MAX == UINT8_MAX) || defined (S_SPLINT_S) - typedef unsigned char uint8_t; -# define UINT8_C(v) ((uint8_t) v) -# else -# error "Platform not supported" -# endif -#endif - -#ifndef INT8_MAX -# define INT8_MAX 0x7f -#endif -#ifndef INT8_MIN -# define INT8_MIN INT8_C(0x80) -#endif -#if !defined(int8_t) && !defined(_INT8_T) && !defined(vxWorks) -# if (SCHAR_MAX == INT8_MAX) || defined (S_SPLINT_S) - typedef signed char int8_t; -# define INT8_C(v) ((int8_t) v) -# else -# error "Platform not supported" -# endif -#endif - -#ifndef UINT16_MAX -# define UINT16_MAX 0xffff -#endif -#if !defined(uint16_t) && !defined(_UINT16_T) && !defined(vxWorks) -#if (UINT_MAX == UINT16_MAX) || defined (S_SPLINT_S) - typedef unsigned int uint16_t; -# ifndef PRINTF_INT16_MODIFIER -# define PRINTF_INT16_MODIFIER "" -# endif -# define UINT16_C(v) ((uint16_t) (v)) -#elif (USHRT_MAX == UINT16_MAX) - typedef unsigned short uint16_t; -# define UINT16_C(v) ((uint16_t) (v)) -# ifndef PRINTF_INT16_MODIFIER -# define PRINTF_INT16_MODIFIER "h" -# endif -#else -#error "Platform not supported" -#endif -#endif - -#ifndef INT16_MAX -# define INT16_MAX 0x7fff -#endif -#ifndef INT16_MIN -# define INT16_MIN INT16_C(0x8000) -#endif -#if !defined(int16_t) && !defined(_INT16_T) && !defined(vxWorks) -#if (INT_MAX == INT16_MAX) || defined (S_SPLINT_S) - typedef signed int int16_t; -# define INT16_C(v) ((int16_t) (v)) -# ifndef PRINTF_INT16_MODIFIER -# define PRINTF_INT16_MODIFIER "" -# endif -#elif (SHRT_MAX == INT16_MAX) - typedef signed short int16_t; -# define INT16_C(v) ((int16_t) (v)) -# ifndef PRINTF_INT16_MODIFIER -# define PRINTF_INT16_MODIFIER "h" -# endif -#else -#error "Platform not supported" -#endif -#endif - -#ifndef UINT32_MAX -# define UINT32_MAX (0xffffffffUL) -#endif -#if !defined(uint32_t) && !defined(_UINT32_T) && !defined(vxWorks) -#if (ULONG_MAX == UINT32_MAX) || defined (S_SPLINT_S) - typedef unsigned long uint32_t; -# define UINT32_C(v) v ## UL -# ifndef PRINTF_INT32_MODIFIER -# define PRINTF_INT32_MODIFIER "l" -# endif -#elif (UINT_MAX == UINT32_MAX) - typedef unsigned int uint32_t; -# ifndef PRINTF_INT32_MODIFIER -# define PRINTF_INT32_MODIFIER "" -# endif -# define UINT32_C(v) v ## U -#elif (USHRT_MAX == UINT32_MAX) - typedef unsigned short uint32_t; -# define UINT32_C(v) ((unsigned short) (v)) -# ifndef PRINTF_INT32_MODIFIER -# define PRINTF_INT32_MODIFIER "" -# endif -#else -#error "Platform not supported" -#endif -#endif - -#ifndef INT32_MAX -# define INT32_MAX (0x7fffffffL) -#endif -#ifndef INT32_MIN -# define INT32_MIN INT32_C(0x80000000) -#endif -#if !defined(int32_t) && !defined(_INT32_T) && !defined(vxWorks) -#if (LONG_MAX == INT32_MAX) || defined (S_SPLINT_S) - typedef signed long int32_t; -# define INT32_C(v) v ## L -# ifndef PRINTF_INT32_MODIFIER -# define PRINTF_INT32_MODIFIER "l" -# endif -#elif (INT_MAX == INT32_MAX) - typedef signed int int32_t; -# define INT32_C(v) v -# ifndef PRINTF_INT32_MODIFIER -# define PRINTF_INT32_MODIFIER "" -# endif -#elif (SHRT_MAX == INT32_MAX) - typedef signed short int32_t; -# define INT32_C(v) ((short) (v)) -# ifndef PRINTF_INT32_MODIFIER -# define PRINTF_INT32_MODIFIER "" -# endif -#else -#error "Platform not supported" -#endif -#endif - -/* - * The macro stdint_int64_defined is temporarily used to record - * whether or not 64 integer support is available. It must be - * defined for any 64 integer extensions for new platforms that are - * added. - */ - -#undef stdint_int64_defined -#if (defined(__STDC__) && defined(__STDC_VERSION__)) || defined (S_SPLINT_S) -# if (__STDC__ && __STDC_VERSION__ >= 199901L) || defined (S_SPLINT_S) -# define stdint_int64_defined - typedef long long int64_t; - typedef unsigned long long uint64_t; -# define UINT64_C(v) v ## ULL -# define INT64_C(v) v ## LL -# ifndef PRINTF_INT64_MODIFIER -# define PRINTF_INT64_MODIFIER "ll" -# endif -# endif -#endif - -#if !defined (stdint_int64_defined) -# if defined(__GNUC__) && !defined(vxWorks) -# define stdint_int64_defined - __extension__ typedef long long int64_t; - __extension__ typedef unsigned long long uint64_t; -# define UINT64_C(v) v ## ULL -# define INT64_C(v) v ## LL -# ifndef PRINTF_INT64_MODIFIER -# define PRINTF_INT64_MODIFIER "ll" -# endif -# elif defined(__MWERKS__) || defined (__SUNPRO_C) || defined (__SUNPRO_CC) || defined (__APPLE_CC__) || defined (_LONG_LONG) || defined (_CRAYC) || defined (S_SPLINT_S) -# define stdint_int64_defined - typedef long long int64_t; - typedef unsigned long long uint64_t; -# define UINT64_C(v) v ## ULL -# define INT64_C(v) v ## LL -# ifndef PRINTF_INT64_MODIFIER -# define PRINTF_INT64_MODIFIER "ll" -# endif -# elif (defined(__WATCOMC__) && defined(__WATCOM_INT64__)) || (defined(_MSC_VER) && _INTEGRAL_MAX_BITS >= 64) || (defined (__BORLANDC__) && __BORLANDC__ > 0x460) || defined (__alpha) || defined (__DECC) -# define stdint_int64_defined - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; -# define UINT64_C(v) v ## UI64 -# define INT64_C(v) v ## I64 -# ifndef PRINTF_INT64_MODIFIER -# define PRINTF_INT64_MODIFIER "I64" -# endif -# endif -#endif - -#if !defined (LONG_LONG_MAX) && defined (INT64_C) -# define LONG_LONG_MAX INT64_C (9223372036854775807) -#endif -#ifndef ULONG_LONG_MAX -# define ULONG_LONG_MAX UINT64_C (18446744073709551615) -#endif - -#if !defined (INT64_MAX) && defined (INT64_C) -# define INT64_MAX INT64_C (9223372036854775807) -#endif -#if !defined (INT64_MIN) && defined (INT64_C) -# define INT64_MIN INT64_C (-9223372036854775808) -#endif -#if !defined (UINT64_MAX) && defined (INT64_C) -# define UINT64_MAX UINT64_C (18446744073709551615) -#endif - -/* - * Width of hexadecimal for number field. - */ - -#ifndef PRINTF_INT64_HEX_WIDTH -# define PRINTF_INT64_HEX_WIDTH "16" -#endif -#ifndef PRINTF_INT32_HEX_WIDTH -# define PRINTF_INT32_HEX_WIDTH "8" -#endif -#ifndef PRINTF_INT16_HEX_WIDTH -# define PRINTF_INT16_HEX_WIDTH "4" -#endif -#ifndef PRINTF_INT8_HEX_WIDTH -# define PRINTF_INT8_HEX_WIDTH "2" -#endif -#ifndef PRINTF_INT64_DEC_WIDTH -# define PRINTF_INT64_DEC_WIDTH "19" -#endif -#ifndef PRINTF_INT32_DEC_WIDTH -# define PRINTF_INT32_DEC_WIDTH "10" -#endif -#ifndef PRINTF_INT16_DEC_WIDTH -# define PRINTF_INT16_DEC_WIDTH "5" -#endif -#ifndef PRINTF_INT8_DEC_WIDTH -# define PRINTF_INT8_DEC_WIDTH "3" -#endif -#ifndef PRINTF_UINT64_DEC_WIDTH -# define PRINTF_UINT64_DEC_WIDTH "20" -#endif -#ifndef PRINTF_UINT32_DEC_WIDTH -# define PRINTF_UINT32_DEC_WIDTH "10" -#endif -#ifndef PRINTF_UINT16_DEC_WIDTH -# define PRINTF_UINT16_DEC_WIDTH "5" -#endif -#ifndef PRINTF_UINT8_DEC_WIDTH -# define PRINTF_UINT8_DEC_WIDTH "3" -#endif - -/* - * Ok, lets not worry about 128 bit integers for now. Moore's law says - * we don't need to worry about that until about 2040 at which point - * we'll have bigger things to worry about. - */ - -#ifdef stdint_int64_defined - typedef int64_t intmax_t; - typedef uint64_t uintmax_t; -# define INTMAX_MAX INT64_MAX -# define INTMAX_MIN INT64_MIN -# define UINTMAX_MAX UINT64_MAX -# define UINTMAX_C(v) UINT64_C(v) -# define INTMAX_C(v) INT64_C(v) -# ifndef PRINTF_INTMAX_MODIFIER -# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER -# endif -# ifndef PRINTF_INTMAX_HEX_WIDTH -# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT64_HEX_WIDTH -# endif -# ifndef PRINTF_INTMAX_DEC_WIDTH -# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT64_DEC_WIDTH -# endif -#else - typedef int32_t intmax_t; - typedef uint32_t uintmax_t; -# define INTMAX_MAX INT32_MAX -# define UINTMAX_MAX UINT32_MAX -# define UINTMAX_C(v) UINT32_C(v) -# define INTMAX_C(v) INT32_C(v) -# ifndef PRINTF_INTMAX_MODIFIER -# define PRINTF_INTMAX_MODIFIER PRINTF_INT32_MODIFIER -# endif -# ifndef PRINTF_INTMAX_HEX_WIDTH -# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT32_HEX_WIDTH -# endif -# ifndef PRINTF_INTMAX_DEC_WIDTH -# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT32_DEC_WIDTH -# endif -#endif - -/* - * Because this file currently only supports platforms which have - * precise powers of 2 as bit sizes for the default integers, the - * least definitions are all trivial. Its possible that a future - * version of this file could have different definitions. - */ - -#ifndef stdint_least_defined - typedef int8_t int_least8_t; - typedef uint8_t uint_least8_t; - typedef int16_t int_least16_t; - typedef uint16_t uint_least16_t; - typedef int32_t int_least32_t; - typedef uint32_t uint_least32_t; -# define PRINTF_LEAST32_MODIFIER PRINTF_INT32_MODIFIER -# define PRINTF_LEAST16_MODIFIER PRINTF_INT16_MODIFIER -# define UINT_LEAST8_MAX UINT8_MAX -# define INT_LEAST8_MAX INT8_MAX -# define UINT_LEAST16_MAX UINT16_MAX -# define INT_LEAST16_MAX INT16_MAX -# define UINT_LEAST32_MAX UINT32_MAX -# define INT_LEAST32_MAX INT32_MAX -# define INT_LEAST8_MIN INT8_MIN -# define INT_LEAST16_MIN INT16_MIN -# define INT_LEAST32_MIN INT32_MIN -# ifdef stdint_int64_defined - typedef int64_t int_least64_t; - typedef uint64_t uint_least64_t; -# define PRINTF_LEAST64_MODIFIER PRINTF_INT64_MODIFIER -# define UINT_LEAST64_MAX UINT64_MAX -# define INT_LEAST64_MAX INT64_MAX -# define INT_LEAST64_MIN INT64_MIN -# endif -#endif -#undef stdint_least_defined - -/* - * The ANSI C committee has defined *int*_fast*_t types as well. This, - * of course, defies rationality -- you can't know what will be fast - * just from the type itself. Even for a given architecture, compatible - * implementations might have different performance characteristics. - * Developers are warned to stay away from these types when using this - * or any other stdint.h. - */ - -typedef int_least8_t int_fast8_t; -typedef uint_least8_t uint_fast8_t; -typedef int_least16_t int_fast16_t; -typedef uint_least16_t uint_fast16_t; -typedef int_least32_t int_fast32_t; -typedef uint_least32_t uint_fast32_t; -#define UINT_FAST8_MAX UINT_LEAST8_MAX -#define INT_FAST8_MAX INT_LEAST8_MAX -#define UINT_FAST16_MAX UINT_LEAST16_MAX -#define INT_FAST16_MAX INT_LEAST16_MAX -#define UINT_FAST32_MAX UINT_LEAST32_MAX -#define INT_FAST32_MAX INT_LEAST32_MAX -#define INT_FAST8_MIN INT_LEAST8_MIN -#define INT_FAST16_MIN INT_LEAST16_MIN -#define INT_FAST32_MIN INT_LEAST32_MIN -#ifdef stdint_int64_defined - typedef int_least64_t int_fast64_t; - typedef uint_least64_t uint_fast64_t; -# define UINT_FAST64_MAX UINT_LEAST64_MAX -# define INT_FAST64_MAX INT_LEAST64_MAX -# define INT_FAST64_MIN INT_LEAST64_MIN -#endif - -#undef stdint_int64_defined - -/* - * Whatever piecemeal, per compiler thing we can do about the wchar_t - * type limits. - */ - -#if defined(__WATCOMC__) || defined(_MSC_VER) || defined (__GNUC__) && !defined(vxWorks) -# include -# ifndef WCHAR_MIN -# define WCHAR_MIN 0 -# endif -# ifndef WCHAR_MAX -# define WCHAR_MAX ((wchar_t)-1) -# endif -#endif - -/* - * Whatever piecemeal, per compiler/platform thing we can do about the - * (u)intptr_t types and limits. - */ - -#if (defined (_MSC_VER) && defined (_UINTPTR_T_DEFINED)) || defined (_UINTPTR_T) -# define STDINT_H_UINTPTR_T_DEFINED -#endif - -#ifndef STDINT_H_UINTPTR_T_DEFINED -# if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (_WIN64) || defined (__ppc64__) -# define stdint_intptr_bits 64 -# elif defined (__WATCOMC__) || defined (__TURBOC__) -# if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__) -# define stdint_intptr_bits 16 -# else -# define stdint_intptr_bits 32 -# endif -# elif defined (__i386__) || defined (_WIN32) || defined (WIN32) || defined (__ppc64__) -# define stdint_intptr_bits 32 -# elif defined (__INTEL_COMPILER) -/* TODO -- what did Intel do about x86-64? */ -# else -/* #error "This platform might not be supported yet" */ -# endif - -# ifdef stdint_intptr_bits -# define stdint_intptr_glue3_i(a,b,c) a##b##c -# define stdint_intptr_glue3(a,b,c) stdint_intptr_glue3_i(a,b,c) -# ifndef PRINTF_INTPTR_MODIFIER -# define PRINTF_INTPTR_MODIFIER stdint_intptr_glue3(PRINTF_INT,stdint_intptr_bits,_MODIFIER) -# endif -# ifndef PTRDIFF_MAX -# define PTRDIFF_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX) -# endif -# ifndef PTRDIFF_MIN -# define PTRDIFF_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN) -# endif -# ifndef UINTPTR_MAX -# define UINTPTR_MAX stdint_intptr_glue3(UINT,stdint_intptr_bits,_MAX) -# endif -# ifndef INTPTR_MAX -# define INTPTR_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX) -# endif -# ifndef INTPTR_MIN -# define INTPTR_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN) -# endif -# ifndef INTPTR_C -# define INTPTR_C(x) stdint_intptr_glue3(INT,stdint_intptr_bits,_C)(x) -# endif -# ifndef UINTPTR_C -# define UINTPTR_C(x) stdint_intptr_glue3(UINT,stdint_intptr_bits,_C)(x) -# endif - typedef stdint_intptr_glue3(uint,stdint_intptr_bits,_t) uintptr_t; - typedef stdint_intptr_glue3( int,stdint_intptr_bits,_t) intptr_t; -# else -/* TODO -- This following is likely wrong for some platforms, and does - nothing for the definition of uintptr_t. */ - typedef ptrdiff_t intptr_t; -# endif -# define STDINT_H_UINTPTR_T_DEFINED -#endif - -/* - * Assumes sig_atomic_t is signed and we have a 2s complement machine. - */ - -#ifndef SIG_ATOMIC_MAX -# define SIG_ATOMIC_MAX ((((sig_atomic_t) 1) << (sizeof (sig_atomic_t)*CHAR_BIT-1)) - 1) -#endif - -#endif - -#if defined (__TEST_PSTDINT_FOR_CORRECTNESS) - -/* - * Please compile with the maximum warning settings to make sure macros are - * not defined more than once. - */ - -#include -#include -#include - -#define glue3_aux(x,y,z) x ## y ## z -#define glue3(x,y,z) glue3_aux(x,y,z) - -#define DECLU(bits) glue3(uint,bits,_t) glue3(u,bits,) = glue3(UINT,bits,_C) (0); -#define DECLI(bits) glue3(int,bits,_t) glue3(i,bits,) = glue3(INT,bits,_C) (0); - -#define DECL(us,bits) glue3(DECL,us,) (bits) - -#define TESTUMAX(bits) glue3(u,bits,) = ~glue3(u,bits,); if (glue3(UINT,bits,_MAX) != glue3(u,bits,)) printf ("Something wrong with UINT%d_MAX\n", bits) - -#define REPORTERROR(msg) { err_n++; if (err_first <= 0) err_first = __LINE__; printf msg; } - -#define X_SIZE_MAX ((size_t)-1) - -int main () { - int err_n = 0; - int err_first = 0; - DECL(I,8) - DECL(U,8) - DECL(I,16) - DECL(U,16) - DECL(I,32) - DECL(U,32) -#ifdef INT64_MAX - DECL(I,64) - DECL(U,64) -#endif - intmax_t imax = INTMAX_C(0); - uintmax_t umax = UINTMAX_C(0); - char str0[256], str1[256]; - - sprintf (str0, "%" PRINTF_INT32_MODIFIER "d", INT32_C(2147483647)); - if (0 != strcmp (str0, "2147483647")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str0)); - if (atoi(PRINTF_INT32_DEC_WIDTH) != (int) strlen(str0)) REPORTERROR (("Something wrong with PRINTF_INT32_DEC_WIDTH : %s\n", PRINTF_INT32_DEC_WIDTH)); - sprintf (str0, "%" PRINTF_INT32_MODIFIER "u", UINT32_C(4294967295)); - if (0 != strcmp (str0, "4294967295")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str0)); - if (atoi(PRINTF_UINT32_DEC_WIDTH) != (int) strlen(str0)) REPORTERROR (("Something wrong with PRINTF_UINT32_DEC_WIDTH : %s\n", PRINTF_UINT32_DEC_WIDTH)); -#ifdef INT64_MAX - sprintf (str1, "%" PRINTF_INT64_MODIFIER "d", INT64_C(9223372036854775807)); - if (0 != strcmp (str1, "9223372036854775807")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str1)); - if (atoi(PRINTF_INT64_DEC_WIDTH) != (int) strlen(str1)) REPORTERROR (("Something wrong with PRINTF_INT64_DEC_WIDTH : %s, %d\n", PRINTF_INT64_DEC_WIDTH, (int) strlen(str1))); - sprintf (str1, "%" PRINTF_INT64_MODIFIER "u", UINT64_C(18446744073709550591)); - if (0 != strcmp (str1, "18446744073709550591")) REPORTERROR (("Something wrong with PRINTF_INT32_MODIFIER : %s\n", str1)); - if (atoi(PRINTF_UINT64_DEC_WIDTH) != (int) strlen(str1)) REPORTERROR (("Something wrong with PRINTF_UINT64_DEC_WIDTH : %s, %d\n", PRINTF_UINT64_DEC_WIDTH, (int) strlen(str1))); -#endif - - sprintf (str0, "%d %x\n", 0, ~0); - - sprintf (str1, "%d %x\n", i8, ~0); - if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i8 : %s\n", str1)); - sprintf (str1, "%u %x\n", u8, ~0); - if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u8 : %s\n", str1)); - sprintf (str1, "%d %x\n", i16, ~0); - if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i16 : %s\n", str1)); - sprintf (str1, "%u %x\n", u16, ~0); - if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u16 : %s\n", str1)); - sprintf (str1, "%" PRINTF_INT32_MODIFIER "d %x\n", i32, ~0); - if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i32 : %s\n", str1)); - sprintf (str1, "%" PRINTF_INT32_MODIFIER "u %x\n", u32, ~0); - if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with u32 : %s\n", str1)); -#ifdef INT64_MAX - sprintf (str1, "%" PRINTF_INT64_MODIFIER "d %x\n", i64, ~0); - if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with i64 : %s\n", str1)); -#endif - sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "d %x\n", imax, ~0); - if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with imax : %s\n", str1)); - sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "u %x\n", umax, ~0); - if (0 != strcmp (str0, str1)) REPORTERROR (("Something wrong with umax : %s\n", str1)); - - TESTUMAX(8); - TESTUMAX(16); - TESTUMAX(32); -#ifdef INT64_MAX - TESTUMAX(64); -#endif - -#define STR(v) #v -#define Q(v) printf ("sizeof " STR(v) " = %u\n", (unsigned) sizeof (v)); - if (err_n) { - printf ("pstdint.h is not correct. Please use sizes below to correct it:\n"); - } - - Q(int) - Q(unsigned) - Q(long int) - Q(short int) - Q(int8_t) - Q(int16_t) - Q(int32_t) -#ifdef INT64_MAX - Q(int64_t) -#endif - -#if UINT_MAX < X_SIZE_MAX - printf ("UINT_MAX < X_SIZE_MAX\n"); -#else - printf ("UINT_MAX >= X_SIZE_MAX\n"); -#endif - printf ("%" PRINTF_INT64_MODIFIER "u vs %" PRINTF_INT64_MODIFIER "u\n", UINT_MAX, X_SIZE_MAX); - - return EXIT_SUCCESS; -} - -#endif diff --git a/compat/stdlib.h b/compat/stdlib.h deleted file mode 100644 index 2f7eaf4..0000000 --- a/compat/stdlib.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * stdlib.h -- - * - * Declares facilities exported by the "stdlib" portion of the C library. - * This file isn't complete in the ANSI-C sense; it only declares things - * that are needed by Tcl. This file is needed even on many systems with - * their own stdlib.h (e.g. SunOS) because not all stdlib.h files declare - * all the procedures needed here (such as strtol/strtoul). - * - * Copyright (c) 1991 The Regents of the University of California. - * Copyright (c) 1994-1998 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution of - * this file, and for a DISCLAIMER OF ALL WARRANTIES. - */ - -#ifndef _STDLIB -#define _STDLIB - -extern void abort(void); -extern double atof(const char *string); -extern int atoi(const char *string); -extern long atol(const char *string); -extern void * calloc(unsigned long numElements, unsigned long size); -extern void exit(int status); -extern void free(void *blockPtr); -extern char * getenv(const char *name); -extern void * malloc(unsigned long numBytes); -extern void qsort(void *base, unsigned long n, unsigned long size, int (*compar)( - const void *element1, const void *element2)); -extern void * realloc(void *ptr, unsigned long numBytes); -extern char * realpath(const char *path, char *resolved_path); -extern int mkstemps(char *templ, int suffixlen); -extern int mkstemp(char *templ); -extern char * mkdtemp(char *templ); -extern long strtol(const char *string, char **endPtr, int base); -extern unsigned long strtoul(const char *string, char **endPtr, int base); - -#endif /* _STDLIB */ diff --git a/generic/tcl.h b/generic/tcl.h index 2b6c947..648aa02 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -301,14 +301,14 @@ extern "C" { */ #ifndef TCL_NO_DEPRECATED -#if defined(_WIN32) && !defined(HAVE_WINNT_IGNORE_VOID) +#if defined(_WIN32) #ifndef VOID #define VOID void typedef char CHAR; typedef short SHORT; typedef long LONG; #endif -#endif /* _WIN32 && !HAVE_WINNT_IGNORE_VOID */ +#endif /* _WIN32 */ /* * Macro to use instead of "void" for arguments that must have type "void *" diff --git a/generic/tclInt.h b/generic/tclInt.h index f4bf769..bb8819c 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -79,11 +79,8 @@ #include #include -#ifdef NO_STDLIB_H -# include "../compat/stdlib.h" -#else -# include -#endif +#include +#include #ifdef NO_STRING_H #include "../compat/string.h" #else diff --git a/generic/tclTomMath.h b/generic/tclTomMath.h index 26db082..41e5b1d 100644 --- a/generic/tclTomMath.h +++ b/generic/tclTomMath.h @@ -1,13 +1,7 @@ #ifndef BN_TCL_H_ #define BN_TCL_H_ -#ifdef MP_NO_STDINT -# ifdef HAVE_STDINT_H -# include -# else -# include "../compat/stdint.h" -# endif -#endif +#include #if defined(TCL_NO_TOMMATH_H) typedef size_t mp_digit; typedef int mp_sign; diff --git a/libtommath/tommath.h b/libtommath/tommath.h index 4bd8f6c..a235210 100644 --- a/libtommath/tommath.h +++ b/libtommath/tommath.h @@ -4,10 +4,7 @@ #ifndef BN_H_ #define BN_H_ -#if !defined(MP_NO_STDINT) && !defined(_STDINT_H) && !defined(_STDINT_H_) \ - && !defined(__CLANG_STDINT_H) && !defined(_STDINT) -# include -#endif +#include #include #include diff --git a/libtommath/tommath_private.h b/libtommath/tommath_private.h index 138d39e..8aab7c3 100644 --- a/libtommath/tommath_private.h +++ b/libtommath/tommath_private.h @@ -4,13 +4,7 @@ #ifndef TOMMATH_PRIV_H_ #define TOMMATH_PRIV_H_ -#ifdef MP_NO_STDINT -#ifdef HAVE_STDINT_H -# include -#else -# include "../compat/stdint.h" -#endif -#endif +#include #include "tclTomMath.h" #include "tommath_class.h" diff --git a/unix/Makefile.in b/unix/Makefile.in index 996cd30..7497135 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -279,7 +279,7 @@ VALGRINDARGS = --tool=memcheck --num-callers=24 \ STUB_CC_SWITCHES = -I"${BUILD_DIR}" -I${UNIX_DIR} -I${GENERIC_DIR} -I${TOMMATH_DIR} \ ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ ${AC_FLAGS} ${ENV_FLAGS} ${EXTRA_CFLAGS} @EXTRA_CC_SWITCHES@ \ - ${NO_DEPRECATED_FLAGS} -DMP_FIXED_CUTOFFS -DMP_NO_STDINT + ${NO_DEPRECATED_FLAGS} -DMP_FIXED_CUTOFFS CC_SWITCHES = $(STUB_CC_SWITCHES) -DBUILD_tcl diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 3717893..874860b 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -2388,7 +2388,7 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [ case 1: case (sizeof(long long)==sizeof(long)): ; }]])],[tcl_cv_type_64bit="long long"],[])]) if test "${tcl_cv_type_64bit}" = none ; then - AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, ['long' and 'long long' have the same size]) + AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Do 'long' and 'long long' have the same size (64-bit)?]) AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) diff --git a/unix/tclConfig.h.in b/unix/tclConfig.h.in index f5c0e8b..49906d0 100644 --- a/unix/tclConfig.h.in +++ b/unix/tclConfig.h.in @@ -244,6 +244,9 @@ /* Define to 1 if `st_blocks' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLOCKS +/* Define to 1 if `st_rdev' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_RDEV + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_EPOLL_H diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h index 5d5b14b..8ac5060 100644 --- a/unix/tclUnixPort.h +++ b/unix/tclUnixPort.h @@ -158,11 +158,6 @@ extern "C" { # include #endif #include -#ifdef HAVE_STDINT_H -# include -#else -# include "../compat/stdint.h" -#endif #include MODULE_SCOPE int TclUnixSetBlockingMode(int fd, int mode); diff --git a/win/Makefile.in b/win/Makefile.in index b282452..e702c3e 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -82,7 +82,7 @@ CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ #CFLAGS = $(CFLAGS_DEBUG) #CFLAGS = $(CFLAGS_OPTIMIZE) #CFLAGS = $(CFLAGS_DEBUG) $(CFLAGS_OPTIMIZE) -CFLAGS = @CFLAGS@ @CFLAGS_DEFAULT@ -DMP_FIXED_CUTOFFS -D__USE_MINGW_ANSI_STDIO=0 -DMP_NO_STDINT +CFLAGS = @CFLAGS@ @CFLAGS_DEFAULT@ -DMP_FIXED_CUTOFFS -D__USE_MINGW_ANSI_STDIO=0 # To compile without backward compatibility and deprecated code uncomment the # following diff --git a/win/configure b/win/configure index ba0007f..4db921a 100755 --- a/win/configure +++ b/win/configure @@ -4801,53 +4801,6 @@ printf "%s\n" "#define EXCEPTION_DISPOSITION int" >>confdefs.h fi - # Check to see if winnt.h defines CHAR, SHORT, and LONG - # even if VOID has already been #defined. The win32api - # used by mingw and cygwin is known to do this. - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for winnt.h that ignores VOID define" >&5 -printf %s "checking for winnt.h that ignores VOID define... " >&6; } -if test ${tcl_cv_winnt_ignore_void+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #define VOID void - #define WIN32_LEAN_AND_MEAN - #include - #undef WIN32_LEAN_AND_MEAN - -int -main (void) -{ - - CHAR c; - SHORT s; - LONG l; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - tcl_cv_winnt_ignore_void=yes -else $as_nop - tcl_cv_winnt_ignore_void=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_winnt_ignore_void" >&5 -printf "%s\n" "$tcl_cv_winnt_ignore_void" >&6; } - if test "$tcl_cv_winnt_ignore_void" = "yes" ; then - -printf "%s\n" "#define HAVE_WINNT_IGNORE_VOID 1" >>confdefs.h - - fi - ac_fn_c_check_header_compile "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" "$ac_includes_default" if test "x$ac_cv_header_stdbool_h" = xyes then : diff --git a/win/tcl.m4 b/win/tcl.m4 index 954c3c0..fff706b 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -938,30 +938,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ [Defined when cygwin/mingw does not support EXCEPTION DISPOSITION]) fi - # Check to see if winnt.h defines CHAR, SHORT, and LONG - # even if VOID has already been #defined. The win32api - # used by mingw and cygwin is known to do this. - - AC_CACHE_CHECK(for winnt.h that ignores VOID define, - tcl_cv_winnt_ignore_void, - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #define VOID void - #define WIN32_LEAN_AND_MEAN - #include - #undef WIN32_LEAN_AND_MEAN - ]], [[ - CHAR c; - SHORT s; - LONG l; - ]])], - [tcl_cv_winnt_ignore_void=yes], - [tcl_cv_winnt_ignore_void=no]) - ) - if test "$tcl_cv_winnt_ignore_void" = "yes" ; then - AC_DEFINE(HAVE_WINNT_IGNORE_VOID, 1, - [Defined when cygwin/mingw ignores VOID define in winnt.h]) - fi - AC_CHECK_HEADER(stdbool.h, [AC_DEFINE(HAVE_STDBOOL_H, 1, [Do we have ?])],) # See if the compiler supports casting to a union type. diff --git a/win/tclWinPort.h b/win/tclWinPort.h index d7d60a4..9eb949b 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -92,12 +92,6 @@ typedef DWORD_PTR * PDWORD_PTR; # include #endif #include -#ifdef HAVE_STDINT_H -# include -#else -# include "../compat/stdint.h" -#endif - #ifndef __GNUC__ # define strncasecmp _strnicmp # define strcasecmp _stricmp -- cgit v0.12 From 04d66a25716cb7738dad3170cca4d0a4683db08a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 27 Jun 2023 06:42:06 +0000 Subject: Remove compat/dirent*.h and some other compat/*.c files: Modern C-compilers all have those now --- compat/dirent.h | 21 --- compat/dirent2.h | 53 ------- compat/memcmp.c | 64 -------- compat/opendir.c | 110 ------------- compat/strstr.c | 70 --------- compat/strtol.c | 77 ---------- compat/strtoul.c | 214 -------------------------- unix/Makefile.in | 15 -- unix/configure | 435 ++++++---------------------------------------------- unix/configure.ac | 38 +---- unix/tcl.m4 | 34 ---- unix/tclConfig.h.in | 15 -- unix/tclUnixPort.h | 12 +- win/tcl.dsp | 44 ------ 14 files changed, 50 insertions(+), 1152 deletions(-) delete mode 100644 compat/dirent.h delete mode 100644 compat/dirent2.h delete mode 100644 compat/memcmp.c delete mode 100644 compat/opendir.c delete mode 100644 compat/strstr.c delete mode 100644 compat/strtol.c delete mode 100644 compat/strtoul.c diff --git a/compat/dirent.h b/compat/dirent.h deleted file mode 100644 index fa6222a..0000000 --- a/compat/dirent.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * dirent.h -- - * - * This file is a replacement for in systems that - * support the old BSD-style with a "struct direct". - * - * Copyright (c) 1991 The Regents of the University of California. - * Copyright (c) 1994 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - */ - -#ifndef _DIRENT -#define _DIRENT - -#include - -#define dirent direct - -#endif /* _DIRENT */ diff --git a/compat/dirent2.h b/compat/dirent2.h deleted file mode 100644 index 5be08ba..0000000 --- a/compat/dirent2.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * dirent.h -- - * - * Declarations of a library of directory-reading procedures - * in the POSIX style ("struct dirent"). - * - * Copyright (c) 1991 The Regents of the University of California. - * Copyright (c) 1994 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - */ - -#ifndef _DIRENT -#define _DIRENT - -/* - * Dirent structure, which holds information about a single - * directory entry. - */ - -#define MAXNAMLEN 255 -#define DIRBLKSIZ 512 - -struct dirent { - long d_ino; /* Inode number of entry */ - short d_reclen; /* Length of this record */ - short d_namlen; /* Length of string in d_name */ - char d_name[MAXNAMLEN + 1]; /* Name must be no longer than this */ -}; - -/* - * State that keeps track of the reading of a directory (clients - * should never look inside this structure; the fields should - * only be accessed by the library procedures). - */ - -typedef struct _dirdesc { - int dd_fd; - long dd_loc; - long dd_size; - char dd_buf[DIRBLKSIZ]; -} DIR; - -/* - * Procedures defined for reading directories: - */ - -extern void closedir (DIR *dirp); -extern DIR * opendir (char *name); -extern struct dirent * readdir (DIR *dirp); - -#endif /* _DIRENT */ diff --git a/compat/memcmp.c b/compat/memcmp.c deleted file mode 100644 index c4e25a8..0000000 --- a/compat/memcmp.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * memcmp.c -- - * - * Source code for the "memcmp" library routine. - * - * Copyright (c) 1998 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution of - * this file, and for a DISCLAIMER OF ALL WARRANTIES. - */ - -#include "tclPort.h" - -/* - * Here is the prototype just in case it is not included in tclPort.h. - */ - -int memcmp(const void *s1, const void *s2, size_t n); - -/* - *---------------------------------------------------------------------- - * - * memcmp -- - * - * Compares two bytes sequences. - * - * Results: - * Compares its arguments, looking at the first n bytes (each interpreted - * as an unsigned char), and returns an integer less than, equal to, or - * greater than 0, according as s1 is less than, equal to, or greater - * than s2 when taken to be unsigned 8 bit numbers. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -memcmp( - const void *s1, /* First string. */ - const void *s2, /* Second string. */ - size_t n) /* Length to compare. */ -{ - const unsigned char *ptr1 = (const unsigned char *) s1; - const unsigned char *ptr2 = (const unsigned char *) s2; - - for ( ; n-- ; ptr1++, ptr2++) { - unsigned char u1 = *ptr1, u2 = *ptr2; - - if (u1 != u2) { - return (u1-u2); - } - } - return 0; -} - -/* - * Local Variables: - * mode: c - * c-basic-offset: 4 - * fill-column: 78 - * End: - */ diff --git a/compat/opendir.c b/compat/opendir.c deleted file mode 100644 index b9e7166..0000000 --- a/compat/opendir.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * opendir.c -- - * - * This file provides dirent-style directory-reading procedures for V7 - * Unix systems that don't have such procedures. The origin of this code - * is unclear, but it seems to have come originally from Larry Wall. - */ - -#include "tclInt.h" - -#undef DIRSIZ -#define DIRSIZ(dp) \ - ((sizeof(struct dirent) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3)) - -/* - * open a directory. - */ - -DIR * -opendir( - char *name) -{ - DIR *dirp; - int fd; - const char *myname; - - myname = ((*name == '\0') ? "." : name); - if ((fd = open(myname, 0, 0)) == -1) { - return NULL; - } - dirp = (DIR *) attemptckalloc(sizeof(DIR)); - if (dirp == NULL) { - /* unreachable? */ - close(fd); - return NULL; - } - dirp->dd_fd = fd; - dirp->dd_loc = 0; - return dirp; -} - -/* - * read an old style directory entry and present it as a new one - */ -#ifndef pyr -#define ODIRSIZ 14 - -struct olddirect { - ino_t od_ino; - char od_name[ODIRSIZ]; -}; -#else /* a Pyramid in the ATT universe */ -#define ODIRSIZ 248 - -struct olddirect { - long od_ino; - short od_fill1, od_fill2; - char od_name[ODIRSIZ]; -}; -#endif - -/* - * get next entry in a directory. - */ - -struct dirent * -readdir( - DIR *dirp) -{ - struct olddirect *dp; - static struct dirent dir; - - for (;;) { - if (dirp->dd_loc == 0) { - dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf, DIRBLKSIZ); - if (dirp->dd_size <= 0) { - return NULL; - } - } - if (dirp->dd_loc >= dirp->dd_size) { - dirp->dd_loc = 0; - continue; - } - dp = (struct olddirect *)(dirp->dd_buf + dirp->dd_loc); - dirp->dd_loc += sizeof(struct olddirect); - if (dp->od_ino == 0) { - continue; - } - dir.d_ino = dp->od_ino; - strncpy(dir.d_name, dp->od_name, ODIRSIZ); - dir.d_name[ODIRSIZ] = '\0'; /* insure null termination */ - dir.d_namlen = strlen(dir.d_name); - dir.d_reclen = DIRSIZ(&dir); - return &dir; - } -} - -/* - * close a directory. - */ - -void -closedir( - DIR *dirp) -{ - close(dirp->dd_fd); - dirp->dd_fd = -1; - dirp->dd_loc = 0; - ckfree(dirp); -} diff --git a/compat/strstr.c b/compat/strstr.c deleted file mode 100644 index 35386d0..0000000 --- a/compat/strstr.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * strstr.c -- - * - * Source code for the "strstr" library routine. - * - * Copyright (c) 1988-1993 The Regents of the University of California. - * Copyright (c) 1994 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution of - * this file, and for a DISCLAIMER OF ALL WARRANTIES. - */ - -#include "tcl.h" -#ifndef NULL -#define NULL 0 -#endif - -/* - *---------------------------------------------------------------------- - * - * strstr -- - * - * Locate the first instance of a substring in a string. - * - * Results: - * If string contains substring, the return value is the location of the - * first matching instance of substring in string. If string doesn't - * contain substring, the return value is 0. Matching is done on an exact - * character-for-character basis with no wildcards or special characters. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -char * -strstr( - const char *string, /* String to search. */ - const char *substring) /* Substring to try to find in string. */ -{ - const char *a, *b; - - /* - * First scan quickly through the two strings looking for a - * single-character match. When it's found, then compare the rest of the - * substring. - */ - - b = substring; - if (*b == 0) { - return (char *)string; - } - for ( ; *string != 0; string += 1) { - if (*string != *b) { - continue; - } - a = string; - while (1) { - if (*b == 0) { - return (char *)string; - } - if (*a++ != *b++) { - break; - } - } - b = substring; - } - return NULL; -} diff --git a/compat/strtol.c b/compat/strtol.c deleted file mode 100644 index a9866f4..0000000 --- a/compat/strtol.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * strtol.c -- - * - * Source code for the "strtol" library procedure. - * - * Copyright (c) 1988 The Regents of the University of California. - * Copyright (c) 1994 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution of - * this file, and for a DISCLAIMER OF ALL WARRANTIES. - */ - -#include "tclInt.h" - -/* - *---------------------------------------------------------------------- - * - * strtol -- - * - * Convert an ASCII string into an integer. - * - * Results: - * The return value is the integer equivalent of string. If endPtr is - * non-NULL, then *endPtr is filled in with the character after the last - * one that was part of the integer. If string doesn't contain a valid - * integer value, then zero is returned and *endPtr is set to string. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -long int -strtol( - const char *string, /* String of ASCII digits, possibly preceded - * by white space. For bases greater than 10, - * either lower- or upper-case digits may be - * used. */ - char **endPtr, /* Where to store address of terminating - * character, or NULL. */ - int base) /* Base for conversion. Must be less than 37. - * If 0, then the base is chosen from the - * leading characters of string: "0x" means - * hex, "0" means octal, anything else means - * decimal. */ -{ - const char *p; - long result; - - /* - * Skip any leading blanks. - */ - - p = string; - while (isspace(UCHAR(*p))) { - p += 1; - } - - /* - * Check for a sign. - */ - - if (*p == '-') { - p += 1; - result = -(strtoul(p, endPtr, base)); - } else { - if (*p == '+') { - p += 1; - } - result = strtoul(p, endPtr, base); - } - if ((result == 0) && (endPtr != 0) && (*endPtr == p)) { - *endPtr = (char *) string; - } - return result; -} diff --git a/compat/strtoul.c b/compat/strtoul.c deleted file mode 100644 index af63036..0000000 --- a/compat/strtoul.c +++ /dev/null @@ -1,214 +0,0 @@ -/* - * strtoul.c -- - * - * Source code for the "strtoul" library procedure. - * - * Copyright (c) 1988 The Regents of the University of California. - * Copyright (c) 1994 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution of - * this file, and for a DISCLAIMER OF ALL WARRANTIES. - */ - -#include "tclInt.h" - -/* - * The table below is used to convert from ASCII digits to a numerical - * equivalent. It maps from '0' through 'z' to integers (100 for non-digit - * characters). - */ - -static const char cvtIn[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, /* '0' - '9' */ - 100, 100, 100, 100, 100, 100, 100, /* punctuation */ - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 'A' - 'Z' */ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, - 100, 100, 100, 100, 100, 100, /* punctuation */ - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 'a' - 'z' */ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35}; - -/* - *---------------------------------------------------------------------- - * - * strtoul -- - * - * Convert an ASCII string into an integer. - * - * Results: - * The return value is the integer equivalent of string. If endPtr is - * non-NULL, then *endPtr is filled in with the character after the last - * one that was part of the integer. If string doesn't contain a valid - * integer value, then zero is returned and *endPtr is set to string. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -unsigned long int -strtoul( - const char *string, /* String of ASCII digits, possibly preceded - * by white space. For bases greater than 10, - * either lower- or upper-case digits may be - * used. */ - char **endPtr, /* Where to store address of terminating - * character, or NULL. */ - int base) /* Base for conversion. Must be less than 37. - * If 0, then the base is chosen from the - * leading characters of string: "0x" means - * hex, "0" means octal, anything else means - * decimal. */ -{ - const char *p; - unsigned long int result = 0; - unsigned digit; - int anyDigits = 0; - int negative=0; - int overflow=0; - - /* - * Skip any leading blanks. - */ - - p = string; - while (isspace(UCHAR(*p))) { - p += 1; - } - if (*p == '-') { - negative = 1; - p += 1; - } else { - if (*p == '+') { - p += 1; - } - } - - /* - * If no base was provided, pick one from the leading characters of the - * string. - */ - - if (base == 0) { - if (*p == '0') { - p += 1; - if ((*p == 'x') || (*p == 'X')) { - p += 1; - base = 16; - } else { - /* - * Must set anyDigits here, otherwise "0" produces a "no - * digits" error. - */ - - anyDigits = 1; - base = 8; - } - } else { - base = 10; - } - } else if (base == 16) { - /* - * Skip a leading "0x" from hex numbers. - */ - - if ((p[0] == '0') && ((p[1] == 'x') || (p[1] == 'X'))) { - p += 2; - } - } - - /* - * Sorry this code is so messy, but speed seems important. Do different - * things for base 8, 10, 16, and other. - */ - - if (base == 8) { - unsigned long maxres = ULONG_MAX >> 3; - - for ( ; ; p += 1) { - digit = *p - '0'; - if (digit > 7) { - break; - } - if (result > maxres) { overflow = 1; } - result = (result << 3); - if (digit > (ULONG_MAX - result)) { overflow = 1; } - result += digit; - anyDigits = 1; - } - } else if (base == 10) { - unsigned long maxres = ULONG_MAX / 10; - - for ( ; ; p += 1) { - digit = *p - '0'; - if (digit > 9) { - break; - } - if (result > maxres) { overflow = 1; } - result *= 10; - if (digit > (ULONG_MAX - result)) { overflow = 1; } - result += digit; - anyDigits = 1; - } - } else if (base == 16) { - unsigned long maxres = ULONG_MAX >> 4; - - for ( ; ; p += 1) { - digit = *p - '0'; - if (digit > ('z' - '0')) { - break; - } - digit = cvtIn[digit]; - if (digit > 15) { - break; - } - if (result > maxres) { overflow = 1; } - result = (result << 4); - if (digit > (ULONG_MAX - result)) { overflow = 1; } - result += digit; - anyDigits = 1; - } - } else if (base >= 2 && base <= 36) { - unsigned long maxres = ULONG_MAX / base; - - for ( ; ; p += 1) { - digit = *p - '0'; - if (digit > ('z' - '0')) { - break; - } - digit = cvtIn[digit]; - if (digit >= ( (unsigned) base )) { - break; - } - if (result > maxres) { overflow = 1; } - result *= base; - if (digit > (ULONG_MAX - result)) { overflow = 1; } - result += digit; - anyDigits = 1; - } - } - - /* - * See if there were any digits at all. - */ - - if (!anyDigits) { - p = string; - } - - if (endPtr != 0) { - /* unsafe, but required by the strtoul prototype */ - *endPtr = (char *) p; - } - - if (overflow) { - errno = ERANGE; - return ULONG_MAX; - } - if (negative) { - return -result; - } - return result; -} diff --git a/unix/Makefile.in b/unix/Makefile.in index 7497135..d2bd30e 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -1881,27 +1881,12 @@ tclXtTest.o: $(UNIX_DIR)/tclXtTest.c # relocatable. #-------------------------------------------------------------------------- -opendir.o: $(COMPAT_DIR)/opendir.c - $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/opendir.c - mkstemp.o: $(COMPAT_DIR)/mkstemp.c $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/mkstemp.c -memcmp.o: $(COMPAT_DIR)/memcmp.c - $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/memcmp.c - strncasecmp.o: $(COMPAT_DIR)/strncasecmp.c $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strncasecmp.c -strstr.o: $(COMPAT_DIR)/strstr.c - $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strstr.c - -strtol.o: $(COMPAT_DIR)/strtol.c - $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strtol.c - -strtoul.o: $(COMPAT_DIR)/strtoul.c - $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/strtoul.c - waitpid.o: $(COMPAT_DIR)/waitpid.c $(CC) -c $(STUB_CC_SWITCHES) $(COMPAT_DIR)/waitpid.c diff --git a/unix/configure b/unix/configure index 7bb92a4..e1623fe 100755 --- a/unix/configure +++ b/unix/configure @@ -1604,53 +1604,6 @@ fi } # ac_fn_c_try_compile -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - } -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in @@ -1722,6 +1675,53 @@ fi } # ac_fn_c_try_cpp +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly @@ -4158,102 +4158,6 @@ printf "%s\n" "$ac_cv_path_EGREP" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dirent.h" >&5 -printf %s "checking dirent.h... " >&6; } -if test ${tcl_cv_dirent_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main (void) -{ - -#ifndef _POSIX_SOURCE -# ifdef __Lynx__ - /* - * Generate compilation error to make the test fail: Lynx headers - * are only valid if really in the POSIX environment. - */ - - missing_procedure(); -# endif -#endif -DIR *d; -struct dirent *entryPtr; -char *p; -d = opendir("foobar"); -entryPtr = readdir(d); -p = entryPtr->d_name; -closedir(d); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - tcl_cv_dirent_h=yes -else $as_nop - tcl_cv_dirent_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_dirent_h" >&5 -printf "%s\n" "$tcl_cv_dirent_h" >&6; } - - if test $tcl_cv_dirent_h = no; then - -printf "%s\n" "#define NO_DIRENT_H 1" >>confdefs.h - - fi - - ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = xyes -then : - tcl_ok=1 -else $as_nop - tcl_ok=0 -fi - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtol" >/dev/null 2>&1 -then : - -else $as_nop - tcl_ok=0 -fi -rm -rf conftest* - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtoul" >/dev/null 2>&1 -then : - -else $as_nop - tcl_ok=0 -fi -rm -rf conftest* - - if test $tcl_ok = 0; then - -printf "%s\n" "#define NO_STDLIB_H 1" >>confdefs.h - - fi ac_fn_c_check_header_compile "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" if test "x$ac_cv_header_string_h" = xyes then : @@ -8120,32 +8024,6 @@ else $as_nop esac fi -ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir" -if test "x$ac_cv_func_opendir" = xyes -then : - printf "%s\n" "#define HAVE_OPENDIR 1" >>confdefs.h - -else $as_nop - case " $LIBOBJS " in - *" opendir.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS opendir.$ac_objext" - ;; -esac - -fi -ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" -if test "x$ac_cv_func_strtol" = xyes -then : - printf "%s\n" "#define HAVE_STRTOL 1" >>confdefs.h - -else $as_nop - case " $LIBOBJS " in - *" strtol.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS strtol.$ac_objext" - ;; -esac - -fi ac_fn_c_check_func "$LINENO" "waitpid" "ac_cv_func_waitpid" if test "x$ac_cv_func_waitpid" = xyes then : @@ -9537,77 +9415,6 @@ fi #-------------------------------------------------------------------- -# Some system have no memcmp or it does not work with 8 bit data, this -# checks it and add memcmp.o to LIBOBJS if needed -#-------------------------------------------------------------------- - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 -printf %s "checking for working memcmp... " >&6; } -if test ${ac_cv_func_memcmp_working+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : - ac_cv_func_memcmp_working=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main (void) -{ - - /* Some versions of memcmp are not 8-bit clean. */ - char c0 = '\100', c1 = '\200', c2 = '\201'; - if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) - return 1; - - /* The Next x86 OpenStep bug shows up only when comparing 16 bytes - or more and with at least one buffer not starting on a 4-byte boundary. - William Lewis provided this test program. */ - { - char foo[21]; - char bar[21]; - int i; - for (i = 0; i < 4; i++) - { - char *a = foo + i; - char *b = bar + i; - strcpy (a, "--------01111111"); - strcpy (b, "--------10000000"); - if (memcmp (a, b, 16) >= 0) - return 1; - } - return 0; - } - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO" -then : - ac_cv_func_memcmp_working=yes -else $as_nop - ac_cv_func_memcmp_working=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 -printf "%s\n" "$ac_cv_func_memcmp_working" >&6; } -test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in - *" memcmp.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" - ;; -esac - - - -#-------------------------------------------------------------------- # Some system like SunOS 4 and other BSD like systems have no memmove # (we assume they have bcopy instead). {The replacement define is in # compat/string.h} @@ -9629,136 +9436,6 @@ fi #-------------------------------------------------------------------- -# On some systems strstr is broken: it returns a pointer even if -# the original string is empty. -#-------------------------------------------------------------------- - - - ac_fn_c_check_func "$LINENO" "strstr" "ac_cv_func_strstr" -if test "x$ac_cv_func_strstr" = xyes -then : - tcl_ok=1 -else $as_nop - tcl_ok=0 -fi - - if test "$tcl_ok" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking proper strstr implementation" >&5 -printf %s "checking proper strstr implementation... " >&6; } -if test ${tcl_cv_strstr_unbroken+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : - tcl_cv_strstr_unbroken=unknown -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -int main() { - exit(strstr("\0test", "test") ? 1 : 0); -} -_ACEOF -if ac_fn_c_try_run "$LINENO" -then : - tcl_cv_strstr_unbroken=ok -else $as_nop - tcl_cv_strstr_unbroken=broken -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_strstr_unbroken" >&5 -printf "%s\n" "$tcl_cv_strstr_unbroken" >&6; } - if test "$tcl_cv_strstr_unbroken" = "ok"; then - tcl_ok=1 - else - tcl_ok=0 - fi - fi - if test "$tcl_ok" = 0; then - case " $LIBOBJS " in - *" strstr.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS strstr.$ac_objext" - ;; -esac - - USE_COMPAT=1 - fi - - -#-------------------------------------------------------------------- -# Check for strtoul function. This is tricky because under some -# versions of AIX strtoul returns an incorrect terminator -# pointer for the string "0". -#-------------------------------------------------------------------- - - - ac_fn_c_check_func "$LINENO" "strtoul" "ac_cv_func_strtoul" -if test "x$ac_cv_func_strtoul" = xyes -then : - tcl_ok=1 -else $as_nop - tcl_ok=0 -fi - - if test "$tcl_ok" = 1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking proper strtoul implementation" >&5 -printf %s "checking proper strtoul implementation... " >&6; } -if test ${tcl_cv_strtoul_unbroken+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes -then : - tcl_cv_strtoul_unbroken=unknown -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -int main() { - char *term, *string = "0"; - exit(strtoul(string,&term,0) != 0 || term != string+1); -} -_ACEOF -if ac_fn_c_try_run "$LINENO" -then : - tcl_cv_strtoul_unbroken=ok -else $as_nop - tcl_cv_strtoul_unbroken=broken -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_strtoul_unbroken" >&5 -printf "%s\n" "$tcl_cv_strtoul_unbroken" >&6; } - if test "$tcl_cv_strtoul_unbroken" = "ok"; then - tcl_ok=1 - else - tcl_ok=0 - fi - fi - if test "$tcl_ok" = 0; then - case " $LIBOBJS " in - *" strtoul.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS strtoul.$ac_objext" - ;; -esac - - USE_COMPAT=1 - fi - - -#-------------------------------------------------------------------- # Check for various typedefs and provide substitutes if # they don't exist. #-------------------------------------------------------------------- @@ -9917,24 +9594,6 @@ fi #-------------------------------------------------------------------- -# If a system doesn't have an opendir function (man, that's old!) -# then we have to supply a different version of dirent.h which -# is compatible with the substitute version of opendir that's -# provided. This version only works with V7-style directories. -#-------------------------------------------------------------------- - -ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir" -if test "x$ac_cv_func_opendir" = xyes -then : - -else $as_nop - -printf "%s\n" "#define USE_DIRENT2_H 1" >>confdefs.h - -fi - - -#-------------------------------------------------------------------- # The check below checks whether defines the type # "union wait" correctly. It's needed because of weirdness in # HP-UX where "union wait" is defined in both the BSD and SYS-V diff --git a/unix/configure.ac b/unix/configure.ac index a695390..653a203 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -229,7 +229,7 @@ AC_CHECK_FUNCS(getcwd, , [AC_DEFINE(USEGETWD, 1, [Is getcwd Posix-compliant?])]) # Nb: if getcwd uses popen and pwd(1) (like SunOS 4) we should really # define USEGETWD even if the posix getcwd exists. Add a test ? -AC_REPLACE_FUNCS(mkstemp opendir strtol waitpid) +AC_REPLACE_FUNCS(mkstemp waitpid) AC_CHECK_FUNC(strerror, , [AC_DEFINE(NO_STRERROR, 1, [Do we have strerror()])]) AC_CHECK_FUNC(getwd, , [AC_DEFINE(NO_GETWD, 1, [Do we have getwd()])]) AC_CHECK_FUNC(wait3, , [AC_DEFINE(NO_WAIT3, 1, [Do we have wait3()])]) @@ -377,13 +377,6 @@ AC_CHECK_TYPES([blkcnt_t]) AC_CHECK_FUNC(fstatfs, , [AC_DEFINE(NO_FSTATFS, 1, [Do we have fstatfs()?])]) #-------------------------------------------------------------------- -# Some system have no memcmp or it does not work with 8 bit data, this -# checks it and add memcmp.o to LIBOBJS if needed -#-------------------------------------------------------------------- - -AC_FUNC_MEMCMP - -#-------------------------------------------------------------------- # Some system like SunOS 4 and other BSD like systems have no memmove # (we assume they have bcopy instead). {The replacement define is in # compat/string.h} @@ -394,26 +387,6 @@ AC_CHECK_FUNC(memmove, , [ AC_DEFINE(NO_STRING_H, 1, [Do we have ?]) ]) #-------------------------------------------------------------------- -# On some systems strstr is broken: it returns a pointer even if -# the original string is empty. -#-------------------------------------------------------------------- - -SC_TCL_CHECK_BROKEN_FUNC(strstr, [ - exit(strstr("\0test", "test") ? 1 : 0); -]) - -#-------------------------------------------------------------------- -# Check for strtoul function. This is tricky because under some -# versions of AIX strtoul returns an incorrect terminator -# pointer for the string "0". -#-------------------------------------------------------------------- - -SC_TCL_CHECK_BROKEN_FUNC(strtoul, [ - char *term, *string = "0"; - exit(strtoul(string,&term,0) != 0 || term != string+1); -]) - -#-------------------------------------------------------------------- # Check for various typedefs and provide substitutes if # they don't exist. #-------------------------------------------------------------------- @@ -439,15 +412,6 @@ AC_CHECK_TYPES([intptr_t, uintptr_t],,,[[ ]]) #-------------------------------------------------------------------- -# If a system doesn't have an opendir function (man, that's old!) -# then we have to supply a different version of dirent.h which -# is compatible with the substitute version of opendir that's -# provided. This version only works with V7-style directories. -#-------------------------------------------------------------------- - -AC_CHECK_FUNC(opendir, , [AC_DEFINE(USE_DIRENT2_H, 1, [May we include ?])]) - -#-------------------------------------------------------------------- # The check below checks whether defines the type # "union wait" correctly. It's needed because of weirdness in # HP-UX where "union wait" is defined in both the BSD and SYS-V diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 874860b..fc0cfb7 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1932,8 +1932,6 @@ dnl # preprocessing tests use only CPPFLAGS. # Results: # # Defines some of the following vars: -# NO_DIRENT_H -# NO_STDLIB_H # NO_STRING_H # NO_SYS_WAIT_H # NO_DLFCN_H @@ -1943,38 +1941,6 @@ dnl # preprocessing tests use only CPPFLAGS. #-------------------------------------------------------------------- AC_DEFUN([SC_MISSING_POSIX_HEADERS], [ - AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include -#include ]], [[ -#ifndef _POSIX_SOURCE -# ifdef __Lynx__ - /* - * Generate compilation error to make the test fail: Lynx headers - * are only valid if really in the POSIX environment. - */ - - missing_procedure(); -# endif -#endif -DIR *d; -struct dirent *entryPtr; -char *p; -d = opendir("foobar"); -entryPtr = readdir(d); -p = entryPtr->d_name; -closedir(d); -]])],[tcl_cv_dirent_h=yes],[tcl_cv_dirent_h=no])]) - - if test $tcl_cv_dirent_h = no; then - AC_DEFINE(NO_DIRENT_H, 1, [Do we have ?]) - fi - - AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) - AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) - AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) - if test $tcl_ok = 0; then - AC_DEFINE(NO_STDLIB_H, 1, [Do we have ?]) - fi AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0) AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0) diff --git a/unix/tclConfig.h.in b/unix/tclConfig.h.in index 49906d0..cd81d4e 100644 --- a/unix/tclConfig.h.in +++ b/unix/tclConfig.h.in @@ -178,9 +178,6 @@ /* Define to 1 if you have the `open64' function. */ #undef HAVE_OPEN64 -/* Define to 1 if you have the `opendir' function. */ -#undef HAVE_OPENDIR - /* Define to 1 if you have the `OSSpinLockLock' function. */ #undef HAVE_OSSPINLOCKLOCK @@ -217,9 +214,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL - /* Define to 1 if the system has the type `struct addrinfo'. */ #undef HAVE_STRUCT_ADDRINFO @@ -334,9 +328,6 @@ /* Is Darwin CoreFoundation unavailable for 64-bit? */ #undef NO_COREFOUNDATION_64 -/* Do we have ? */ -#undef NO_DIRENT_H - /* Do we have ? */ #undef NO_DLFCN_H @@ -364,9 +355,6 @@ /* Do we have realpath() */ #undef NO_REALPATH -/* Do we have ? */ -#undef NO_STDLIB_H - /* Do we have strerror() */ #undef NO_STRERROR @@ -459,9 +447,6 @@ /* Is getcwd Posix-compliant? */ #undef USEGETWD -/* May we include ? */ -#undef USE_DIRENT2_H - /* Are we building with DTrace support? */ #undef USE_DTRACE diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h index 8ac5060..8f13ecd 100644 --- a/unix/tclUnixPort.h +++ b/unix/tclUnixPort.h @@ -7,7 +7,7 @@ * file that contains #ifdefs to handle different flavors of UNIX. This * file sets up the union of all UNIX-related things needed by any of the * Tcl core files. This file depends on configuration #defines such as - * NO_DIRENT_H that are set up by the "configure" script. + * HAVE_SYS_PARAM_H that are set up by the "configure" script. * * Much of the material in this file was originally contributed by Karl * Lehenbauer, Mark Diekhans and Peter da Silva. @@ -40,15 +40,7 @@ # include #endif #include -#ifdef USE_DIRENT2_H -# include "../compat/dirent2.h" -#else -#ifdef NO_DIRENT_H -# include "../compat/dirent.h" -#else -# include -#endif -#endif +#include /* *--------------------------------------------------------------------------- diff --git a/win/tcl.dsp b/win/tcl.dsp index aff1000..93e093c 100644 --- a/win/tcl.dsp +++ b/win/tcl.dsp @@ -136,14 +136,6 @@ CFG=tcl - Win32 Debug Static # PROP Default_Filter "" # Begin Source File -SOURCE=..\compat\dirent.h -# End Source File -# Begin Source File - -SOURCE=..\compat\dirent2.h -# End Source File -# Begin Source File - SOURCE=..\compat\dlfcn.h # End Source File # Begin Source File @@ -156,48 +148,12 @@ SOURCE=..\compat\limits.h # End Source File # Begin Source File -SOURCE=..\compat\memcmp.c -# End Source File -# Begin Source File - -SOURCE=..\compat\opendir.c -# End Source File -# Begin Source File - SOURCE=..\compat\README # End Source File # Begin Source File -SOURCE=..\compat\stdlib.h -# End Source File -# Begin Source File - SOURCE=..\compat\string.h # End Source File -# Begin Source File - -SOURCE=..\compat\strncasecmp.c -# End Source File -# Begin Source File - -SOURCE=..\compat\strstr.c -# End Source File -# Begin Source File - -SOURCE=..\compat\strtol.c -# End Source File -# Begin Source File - -SOURCE=..\compat\strtoul.c -# End Source File -# Begin Source File - -SOURCE=..\compat\tclErrno.h -# End Source File -# Begin Source File - -SOURCE=..\compat\waitpid.c -# End Source File # End Group # Begin Group "doc" -- cgit v0.12 From 53cfe378b381c02747bc77cbc908d7dff4c328c3 Mon Sep 17 00:00:00 2001 From: pooryorick Date: Tue, 27 Jun 2023 10:07:19 +0000 Subject: Fix previous errors in encoding.test --- tests/encoding.test | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tests/encoding.test b/tests/encoding.test index 506ab2c..edca5f0 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -588,13 +588,13 @@ test encoding-16.22 {Utf16ToUtfProc, strict, bug [db7a085bd9]} -body { test encoding-16.23 {Utf16ToUtfProc, strict, bug [db7a085bd9]} -body { encoding convertfrom -profile strict utf-16le \x00\xDC } -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\x00'} -test {encoding-24.4 utf-8 invalid strict} {Parse invalid utf-8, strict} -body { - string length [encoding convertfrom -profile strict utf-8 "\xC0\x80"] -} -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\xC0'} -test {encoding-24.4 utf-8 invalid tcl8} {UtfToUtfProc utf-8} { - encoding convertfrom -profile tcl8 utf-8 \xC0\x80 -} \x00 -test encoding-16.25 {Utf32ToUtfProc} -body { +test encoding-16.24 {Utf32ToUtfProc} -body { + encoding convertfrom utf-32 "\xFF\xFF\xFF\xFF" +} -result \uFFFD +test {encoding-16.25 strict} {Utf32ToUtfProc} -body { + encoding convertfrom -profile strict utf-32 "\x01\x00\x00\x01" +} -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\x01'} +test {encoding-16.25 tcl8} {Utf32ToUtfProc} -body { encoding convertfrom -profile tcl8 utf-32 "\x01\x00\x00\x01" } -result \uFFFD @@ -779,9 +779,12 @@ test encoding-24.3 {EscapeFreeProc on open channels} {stdio} { list $count [viewable $line] } [list 3 "乎乞也 (\\u4E4E\\u4E5E\\u4E5F)"] -test encoding-24.4 {Parse valid or invalid utf-8} { - string length [encoding convertfrom -profile tcl8 utf-8 "\xC0\x80"] -} 1 +test {encoding-24.4 utf-8 invalid strict} {Parse invalid utf-8, strict} -body { + encoding convertfrom -profile strict utf-8 "\xC0\x80" +} -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\xC0'} +test {encoding-24.4 utf-8 invalid tcl8} {UtfToUtfProc utf-8} { + encoding convertfrom -profile tcl8 utf-8 \xC0\x80 +} \x00 test encoding-24.5 {Parse valid or invalid utf-8} { string length [encoding convertfrom -profile tcl8 utf-8 "\xC0\x81"] } 2 -- cgit v0.12 From d273c052a59ec196e09cf2f9b87d466ed08d6b2e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 27 Jun 2023 12:57:13 +0000 Subject: Fix [24a8c16dbd]: bigdata.test: invalid command name "testbigdata" on 32-bit --- tests/bigdata.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/bigdata.test b/tests/bigdata.test index 5eb7b89..b7afbbc 100644 --- a/tests/bigdata.test +++ b/tests/bigdata.test @@ -112,8 +112,10 @@ proc bigPatlenMultiple {limit} { set ::bigLengths(intmax) 0x7fffffff set ::bigLengths(uintmax) 0xffffffff # Some tests are more convenient if operands are multiple of pattern length +if {[testConstraint bigdata]} { set ::bigLengths(patlenmultiple) [bigPatlenMultiple $::bigLengths(intmax)] set ::bigLengths(upatlenmultiple) [bigPatlenMultiple $::bigLengths(uintmax)] +} # # script limits -- cgit v0.12