summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-07-18 11:56:23 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-07-18 11:56:23 (GMT)
commit004fe2d35203d7d11d592e8808c83f8a04dfeb31 (patch)
tree205b18d8409c76f046212d0bc0457ec465dead68
parentb0dd51b115eda106d6dd034f4867d446d28f4e1c (diff)
downloadtcl-004fe2d35203d7d11d592e8808c83f8a04dfeb31.zip
tcl-004fe2d35203d7d11d592e8808c83f8a04dfeb31.tar.gz
tcl-004fe2d35203d7d11d592e8808c83f8a04dfeb31.tar.bz2
Updste stdlib.h (add missing functions). Restructure tclAppInit.c
-rw-r--r--compat/stdlib.h14
-rw-r--r--unix/tclAppInit.c10
-rw-r--r--win/tclAppInit.c26
3 files changed, 29 insertions, 21 deletions
diff --git a/compat/stdlib.h b/compat/stdlib.h
index bb0f133..2f7eaf4 100644
--- a/compat/stdlib.h
+++ b/compat/stdlib.h
@@ -21,14 +21,18 @@ extern void abort(void);
extern double atof(const char *string);
extern int atoi(const char *string);
extern long atol(const char *string);
-extern char * calloc(unsigned int numElements, unsigned int size);
+extern void * calloc(unsigned long numElements, unsigned long size);
extern void exit(int status);
-extern int free(char *blockPtr);
+extern void free(void *blockPtr);
extern char * getenv(const char *name);
-extern char * malloc(unsigned int numBytes);
-extern void qsort(void *base, int n, int size, int (*compar)(
+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 char * realloc(char *ptr, unsigned int numBytes);
+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);
diff --git a/unix/tclAppInit.c b/unix/tclAppInit.c
index 3f69f45..51a4cb5 100644
--- a/unix/tclAppInit.c
+++ b/unix/tclAppInit.c
@@ -12,13 +12,15 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#if defined(BUILD_tcl) || defined(USE_TCL_STUBS)
-#error "Don't build with BUILD_tcl/USE_TCL_STUBS!"
-#endif
#include "tcl.h"
-#if TCL_MAJOR_VERSION < 9 && TCL_MINOR_VERSION < 7
+#if TCL_MAJOR_VERSION < 9
+# if defined(BUILD_tcl) || defined(USE_TCL_STUBS)
+# error "Don't build with BUILD_tcl/USE_TCL_STUBS!"
+# endif
+# if TCL_MINOR_VERSION < 7
# define Tcl_LibraryInitProc Tcl_PackageInitProc
# define Tcl_StaticLibrary Tcl_StaticPackage
+# endif
#endif
#ifdef TCL_TEST
diff --git a/win/tclAppInit.c b/win/tclAppInit.c
index 4dd6c6e..53ac274 100644
--- a/win/tclAppInit.c
+++ b/win/tclAppInit.c
@@ -14,21 +14,15 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#if defined(BUILD_tcl) || defined(USE_TCL_STUBS)
-#error "Don't build with BUILD_tcl/USE_TCL_STUBS!"
-#endif
#include "tcl.h"
-#define WIN32_LEAN_AND_MEAN
-#define STRICT /* See MSDN Article Q83456 */
-#include <windows.h>
-#undef STRICT
-#undef WIN32_LEAN_AND_MEAN
-#include <locale.h>
-#include <stdlib.h>
-#include <tchar.h>
-#if TCL_MAJOR_VERSION < 9 && TCL_MINOR_VERSION < 7
+#if TCL_MAJOR_VERSION < 9
+# if defined(BUILD_tcl) || defined(USE_TCL_STUBS)
+# error "Don't build with BUILD_tcl/USE_TCL_STUBS!"
+# endif
+# if TCL_MINOR_VERSION < 7
# define Tcl_LibraryInitProc Tcl_PackageInitProc
# define Tcl_StaticLibrary Tcl_StaticPackage
+# endif
#endif
#ifdef TCL_TEST
@@ -42,6 +36,14 @@ extern Tcl_LibraryInitProc Dde_Init;
extern Tcl_LibraryInitProc Dde_SafeInit;
#endif
+#define WIN32_LEAN_AND_MEAN
+#define STRICT /* See MSDN Article Q83456 */
+#include <windows.h>
+#undef STRICT
+#undef WIN32_LEAN_AND_MEAN
+#include <locale.h>
+#include <stdlib.h>
+#include <tchar.h>
#if defined(__GNUC__) || defined(TCL_BROKEN_MAINARGS)
int _CRT_glob = 0;
#endif /* __GNUC__ || TCL_BROKEN_MAINARGS */