Tcl Source Code

Check-in [a3f95a3b3d]
Login

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

Overview
Comment:get rid of _ANSI_ARGS_
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: a3f95a3b3dcf92a68cee4b5950ea33e8806fa97c
User & Date: jan.nijtmans 2012-04-26 19:42:20
Context
2012-04-27
08:49
Make 'auto_execok START' do the Right Thing check-in: cdcff6d669 user: dkf tags: core-8-5-branch
2012-04-26
19:59
get rid of _ANSI_ARGS_ and CONST check-in: ce95e51ad2 user: jan.nijtmans tags: trunk
19:42
get rid of _ANSI_ARGS_ check-in: a3f95a3b3d user: jan.nijtmans tags: core-8-5-branch
15:03
compiler warning check-in: 64764a7fb3 user: jan.nijtmans tags: core-8-4-branch
14:59
compiler warning check-in: 4a7bc2d107 user: jan.nijtmans tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.









1
2
3
4
5
6
7








2012-04-24  Jan Nijtmans  <[email protected]>

	* generic/tclInt.decls:      [Bug 3508771] load tclreg.dll in cygwin tclsh
	* generic/tclIntPlatDecls.h: Implement TclWinGetSockOpt, TclWinGetServByName
	* generic/tclStubInit.c:     and TclWinCPUID for Cygwin
	* generic/tclUnixCompat.c:
	* unix/configure.in:
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2012-04-26  Jan Nijtmans  <[email protected]>

	* generic/tclStubInit.c:    get rid of _ANSI_ARGS_
	* generic/tclIntPlatDecls.h
	* unix/tclUnixPort.h
	* unix/tclAppInit.c
	* win/tclAppInit.c

2012-04-24  Jan Nijtmans  <[email protected]>

	* generic/tclInt.decls:      [Bug 3508771] load tclreg.dll in cygwin tclsh
	* generic/tclIntPlatDecls.h: Implement TclWinGetSockOpt, TclWinGetServByName
	* generic/tclStubInit.c:     and TclWinCPUID for Cygwin
	* generic/tclUnixCompat.c:
	* unix/configure.in:

Changes to generic/tclIntPlatDecls.h.

1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157

# if defined(USE_TCL_STUBS)
#   undef TclpCreateProcess
#   undef TclpMakeFile
#   undef TclpOpenFile
#   undef TclpCreateCommandChannel
#   ifdef __CYGWIN__
#	define TclpCreateProcess ((int (*) _ANSI_ARGS_((Tcl_Interp *, int, \
		CONST char **, TclFile, TclFile, TclFile, Tcl_Pid *))) \
		tclIntPlatStubsPtr->tclMacOSXGetFileAttribute)
#	define TclpMakeFile ((TclFile (*) _ANSI_ARGS_((Tcl_Channel channel, \
	    int direction))) tclIntPlatStubsPtr->tclMacOSXMatchType)
#	define TclpOpenFile ((TclFile (*) _ANSI_ARGS_((CONST char *, int))) \
	    tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode)
#	define TclpCreateCommandChannel ((Tcl_Channel (*) _ANSI_ARGS_((TclFile, TclFile, \
	    TclFile, int, Tcl_Pid *))) tclIntPlatStubsPtr->tclIntPlatReserved13)
#   else
#	define TclpCreateProcess ((int (*) _ANSI_ARGS_((Tcl_Interp *, int, \
		CONST char **, TclFile, TclFile, TclFile, Tcl_Pid *))) \
		tclIntPlatStubsPtr->tclWinGetTclInstance)
#	define TclpMakeFile ((TclFile (*) _ANSI_ARGS_((Tcl_Channel channel, \
	    int direction))) tclIntPlatStubsPtr->tclWinNToHS)
#	define TclpOpenFile ((TclFile (*) _ANSI_ARGS_((CONST char *, int))) \
	    tclIntPlatStubsPtr->tclWinSetSockOpt)
#	define TclpCreateCommandChannel ((Tcl_Channel (*) _ANSI_ARGS_((TclFile, TclFile, \
	    TclFile, int, Tcl_Pid *))) tclIntPlatStubsPtr->tclWinGetServByName)

#	undef TclpCreateTempFile
#	undef TclGetAndDetachPids
#	undef TclpCloseFile
#	undef TclpCreatePipe
#	undef TclpInetNtoa
#	undef TclUnixWaitForFile

#	define TclpCreateTempFile ((TclFile (*) _ANSI_ARGS_((CONST char *))) \
		tclIntPlatStubsPtr->tclWinGetPlatformId)
#	define TclGetAndDetachPids ((void (*) _ANSI_ARGS_((Tcl_Interp *, Tcl_Channel))) \
	    tclIntPlatStubsPtr->tclWinConvertError)
#	define TclpCloseFile ((int (*) _ANSI_ARGS_((TclFile))) \
	    tclIntPlatStubsPtr->tclWinConvertWSAError)
#	define TclpCreatePipe ((int (*)_ANSI_ARGS_((TclFile *, TclFile *))) \
	    tclIntPlatStubsPtr->tclWinGetSockOpt)
#	define TclpInetNtoa ((char *(*) _ANSI_ARGS_((struct in_addr addr))) \
	    tclIntPlatStubsPtr->tclIntPlatReserved13)
#	define TclUnixWaitForFile (int (*) _ANSI_ARGS_((int, int, int))) \
		tclIntPlatStubsPtr->tclpGetPid)
#	endif
# endif
#endif

#endif /* _TCLINTPLATDECLS */







|
|

|
|
|

|
|

|
|

|
|
|

|
|








|

|

|

|

|

|






1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157

# if defined(USE_TCL_STUBS)
#   undef TclpCreateProcess
#   undef TclpMakeFile
#   undef TclpOpenFile
#   undef TclpCreateCommandChannel
#   ifdef __CYGWIN__
#	define TclpCreateProcess ((int (*) (Tcl_Interp *, int, \
		CONST char **, TclFile, TclFile, TclFile, Tcl_Pid *)) \
		tclIntPlatStubsPtr->tclMacOSXGetFileAttribute)
#	define TclpMakeFile ((TclFile (*) (Tcl_Channel channel, \
	    int direction)) tclIntPlatStubsPtr->tclMacOSXMatchType)
#	define TclpOpenFile ((TclFile (*) (CONST char *, int)) \
	    tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode)
#	define TclpCreateCommandChannel ((Tcl_Channel (*) (TclFile, TclFile, \
	    TclFile, int, Tcl_Pid *)) tclIntPlatStubsPtr->tclIntPlatReserved13)
#   else
#	define TclpCreateProcess ((int (*) (Tcl_Interp *, int, \
		CONST char **, TclFile, TclFile, TclFile, Tcl_Pid *)) \
		tclIntPlatStubsPtr->tclWinGetTclInstance)
#	define TclpMakeFile ((TclFile (*) (Tcl_Channel channel, \
	    int direction)) tclIntPlatStubsPtr->tclWinNToHS)
#	define TclpOpenFile ((TclFile (*) (CONST char *, int)) \
	    tclIntPlatStubsPtr->tclWinSetSockOpt)
#	define TclpCreateCommandChannel ((Tcl_Channel (*) (TclFile, TclFile, \
	    TclFile, int, Tcl_Pid *)) tclIntPlatStubsPtr->tclWinGetServByName)

#	undef TclpCreateTempFile
#	undef TclGetAndDetachPids
#	undef TclpCloseFile
#	undef TclpCreatePipe
#	undef TclpInetNtoa
#	undef TclUnixWaitForFile

#	define TclpCreateTempFile ((TclFile (*) (CONST char *)) \
		tclIntPlatStubsPtr->tclWinGetPlatformId)
#	define TclGetAndDetachPids ((void (*) (Tcl_Interp *, Tcl_Channel)) \
	    tclIntPlatStubsPtr->tclWinConvertError)
#	define TclpCloseFile ((int (*) (TclFile)) \
	    tclIntPlatStubsPtr->tclWinConvertWSAError)
#	define TclpCreatePipe ((int (*) (TclFile *, TclFile *)) \
	    tclIntPlatStubsPtr->tclWinGetSockOpt)
#	define TclpInetNtoa ((char *(*) (struct in_addr addr)) \
	    tclIntPlatStubsPtr->tclIntPlatReserved13)
#	define TclUnixWaitForFile (int (*) (int, int, int)) \
		tclIntPlatStubsPtr->tclpGetPid)
#	endif
# endif
#endif

#endif /* _TCLINTPLATDECLS */

Changes to generic/tclStubInit.c.

189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
    if (!winTCharEncoding) {
	winTCharEncoding = Tcl_GetEncoding(0, "unicode");
    }
    return Tcl_ExternalToUtfDString(winTCharEncoding,
	    string, len, dsPtr);
}

#define Tcl_MacOSXOpenBundleResources (int (*) _ANSI_ARGS_(( \
		Tcl_Interp *, const char *, int, int, char *))) Tcl_WinUtfToTChar
#define Tcl_MacOSXOpenVersionedBundleResources (int (*) _ANSI_ARGS_(( \
		Tcl_Interp *, const char *, const char *, int, int, char *))) Tcl_WinTCharToUtf
#define TclMacOSXGetFileAttribute (int (*) _ANSI_ARGS_((Tcl_Interp *,  \
		int, Tcl_Obj *, Tcl_Obj **))) TclpCreateProcess
#define TclMacOSXMatchType (int (*) _ANSI_ARGS_((Tcl_Interp *, const char *, \
		const char *, Tcl_StatBuf *, Tcl_GlobTypeData *))) TclpMakeFile
#define TclMacOSXNotifierAddRunLoopMode (void (*) _ANSI_ARGS_((const void *))) TclpOpenFile
#define TclpLocaltime_unix (struct tm *(*) _ANSI_ARGS_((const time_t *))) TclGetAndDetachPids
#define TclpGmtime_unix (struct tm *(*) _ANSI_ARGS_((const time_t *))) TclpCloseFile

#elif !defined(__WIN32__) /* UNIX and MAC */
#   define TclWinConvertError (void (*) _ANSI_ARGS_((unsigned int))) TclGetAndDetachPids
#   define TclWinConvertWSAError (void (*) _ANSI_ARGS_((unsigned int))) TclpCloseFile
#   define TclWinGetPlatformId (int (*)()) TclpCreateTempFile
#   define TclWinGetTclInstance (void *(*)()) TclpCreateProcess
#   define TclWinNToHS (unsigned short (*) _ANSI_ARGS_((unsigned short ns))) TclpMakeFile
#   define TclWinSetSockOpt (int (*) _ANSI_ARGS_((void *, int, int, const char *, int))) TclpOpenFile
#   define TclWinGetSockOpt (int (*) _ANSI_ARGS_((void *, int, int, char *, int *))) TclpCreatePipe
#   define TclWinGetServByName (struct servent *(*) _ANSI_ARGS_((const char *nm, const char *proto))) TclpCreateCommandChannel
#   define TclIntPlatReserved13 (void (*) ()) TclpInetNtoa
#   define TclWinAddProcess 0
#   define TclWinNoBackslash 0
#   define TclWinSetInterfaces 0
#   define TclWinFlushDirtyChannels 0
#   define TclWinResetInterfaces 0
#   define TclpGetPid 0







|
|
|
|
|
|
|
|
|
|
|


|
|


|
|
|
|







189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
    if (!winTCharEncoding) {
	winTCharEncoding = Tcl_GetEncoding(0, "unicode");
    }
    return Tcl_ExternalToUtfDString(winTCharEncoding,
	    string, len, dsPtr);
}

#define Tcl_MacOSXOpenBundleResources (int (*) ( \
		Tcl_Interp *, const char *, int, int, char *)) Tcl_WinUtfToTChar
#define Tcl_MacOSXOpenVersionedBundleResources (int (*) ( \
		Tcl_Interp *, const char *, const char *, int, int, char *)) Tcl_WinTCharToUtf
#define TclMacOSXGetFileAttribute (int (*) (Tcl_Interp *,  \
		int, Tcl_Obj *, Tcl_Obj **)) TclpCreateProcess
#define TclMacOSXMatchType (int (*) (Tcl_Interp *, const char *, \
		const char *, Tcl_StatBuf *, Tcl_GlobTypeData *)) TclpMakeFile
#define TclMacOSXNotifierAddRunLoopMode (void (*) (const void *)) TclpOpenFile
#define TclpLocaltime_unix (struct tm *(*) (const time_t *)) TclGetAndDetachPids
#define TclpGmtime_unix (struct tm *(*) (const time_t *)) TclpCloseFile

#elif !defined(__WIN32__) /* UNIX and MAC */
#   define TclWinConvertError (void (*) (unsigned int)) TclGetAndDetachPids
#   define TclWinConvertWSAError (void (*) (unsigned int)) TclpCloseFile
#   define TclWinGetPlatformId (int (*)()) TclpCreateTempFile
#   define TclWinGetTclInstance (void *(*)()) TclpCreateProcess
#   define TclWinNToHS (unsigned short (*) (unsigned short ns)) TclpMakeFile
#   define TclWinSetSockOpt (int (*) (void *, int, int, const char *, int)) TclpOpenFile
#   define TclWinGetSockOpt (int (*) (void *, int, int, char *, int *)) TclpCreatePipe
#   define TclWinGetServByName (struct servent *(*) (const char *nm, const char *proto)) TclpCreateCommandChannel
#   define TclIntPlatReserved13 (void (*) ()) TclpInetNtoa
#   define TclWinAddProcess 0
#   define TclWinNoBackslash 0
#   define TclWinSetInterfaces 0
#   define TclWinFlushDirtyChannels 0
#   define TclWinResetInterfaces 0
#   define TclpGetPid 0

Changes to unix/tclAppInit.c.

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
extern Tcl_PackageInitProc	Procbodytest_SafeInit;
extern Tcl_PackageInitProc	TclObjTest_Init;
extern Tcl_PackageInitProc	Tcltest_Init;

#endif /* TCL_TEST */

#ifdef TCL_XT_TEST
extern void		XtToolkitInitialize _ANSI_ARGS_((void));
extern int		Tclxttest_Init _ANSI_ARGS_((Tcl_Interp *interp));
#endif

/*
 *----------------------------------------------------------------------
 *
 * main --
 *







|
|







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
extern Tcl_PackageInitProc	Procbodytest_SafeInit;
extern Tcl_PackageInitProc	TclObjTest_Init;
extern Tcl_PackageInitProc	Tcltest_Init;

#endif /* TCL_TEST */

#ifdef TCL_XT_TEST
extern void		XtToolkitInitialize (void);
extern int		Tclxttest_Init (Tcl_Interp *interp);
#endif

/*
 *----------------------------------------------------------------------
 *
 * main --
 *
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
     * file. The #if checks for that #define and uses Tcl_AppInit if it does
     * not exist.
     */

#ifndef TCL_LOCAL_APPINIT
#define TCL_LOCAL_APPINIT Tcl_AppInit
#endif
    extern int TCL_LOCAL_APPINIT _ANSI_ARGS_((Tcl_Interp *interp));

    /*
     * The following #if block allows you to change how Tcl finds the startup
     * script, prime the library or encoding paths, fiddle with the argv,
     * etc., without needing to rewrite Tcl_Main()
     */

#ifdef TCL_LOCAL_MAIN_HOOK
    extern int TCL_LOCAL_MAIN_HOOK _ANSI_ARGS_((int *argc, char ***argv));
#endif

#ifdef TCL_XT_TEST
    XtToolkitInitialize();
#endif

#ifdef TCL_LOCAL_MAIN_HOOK







|








|







58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
     * file. The #if checks for that #define and uses Tcl_AppInit if it does
     * not exist.
     */

#ifndef TCL_LOCAL_APPINIT
#define TCL_LOCAL_APPINIT Tcl_AppInit
#endif
    extern int TCL_LOCAL_APPINIT (Tcl_Interp *interp);

    /*
     * The following #if block allows you to change how Tcl finds the startup
     * script, prime the library or encoding paths, fiddle with the argv,
     * etc., without needing to rewrite Tcl_Main()
     */

#ifdef TCL_LOCAL_MAIN_HOOK
    extern int TCL_LOCAL_MAIN_HOOK (int *argc, char ***argv);
#endif

#ifdef TCL_XT_TEST
    XtToolkitInitialize();
#endif

#ifdef TCL_LOCAL_MAIN_HOOK

Changes to unix/tclUnixPort.h.

255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
#else
#   ifdef HAVE_BSDGETTIMEOFDAY
#	define gettimeofday BSDgettimeofday
#   endif
#endif

#ifdef GETTOD_NOT_DECLARED
EXTERN int		gettimeofday _ANSI_ARGS_((struct timeval *tp,
			    struct timezone *tzp));
#endif

/*
 * Define access mode constants if they aren't already defined.
 */

#ifndef F_OK







|
|







255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
#else
#   ifdef HAVE_BSDGETTIMEOFDAY
#	define gettimeofday BSDgettimeofday
#   endif
#endif

#ifdef GETTOD_NOT_DECLARED
EXTERN int		gettimeofday (struct timeval *tp,
			    struct timezone *tzp);
#endif

/*
 * Define access mode constants if they aren't already defined.
 */

#ifndef F_OK
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
#	    include <pthread.h>
#	    include <pthread_np.h>
#	endif
#   else
#	ifdef HAVE_PTHREAD_GETATTR_NP
#	    define TclpPthreadGetAttrs	pthread_getattr_np
#	    ifdef GETATTRNP_NOT_DECLARED
EXTERN int pthread_getattr_np _ANSI_ARGS_((pthread_t, pthread_attr_t *));
#	    endif
#	endif /* HAVE_PTHREAD_GETATTR_NP */
#   endif /* HAVE_PTHREAD_ATTR_GET_NP */
#endif /* TCL_THREADS */

/*
 * Set of MT-safe implementations of some







|







618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
#	    include <pthread.h>
#	    include <pthread_np.h>
#	endif
#   else
#	ifdef HAVE_PTHREAD_GETATTR_NP
#	    define TclpPthreadGetAttrs	pthread_getattr_np
#	    ifdef GETATTRNP_NOT_DECLARED
EXTERN int pthread_getattr_np (pthread_t, pthread_attr_t *);
#	    endif
#	endif /* HAVE_PTHREAD_GETATTR_NP */
#   endif /* HAVE_PTHREAD_ATTR_GET_NP */
#endif /* TCL_THREADS */

/*
 * Set of MT-safe implementations of some

Changes to win/tclAppInit.c.

55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
     * file. The #if checks for that #define and uses Tcl_AppInit if it
     * doesn't exist.
     */

#ifndef TCL_LOCAL_APPINIT
#define TCL_LOCAL_APPINIT Tcl_AppInit
#endif
    extern int TCL_LOCAL_APPINIT _ANSI_ARGS_((Tcl_Interp *interp));

    /*
     * The following #if block allows you to change how Tcl finds the startup
     * script, prime the library or encoding paths, fiddle with the argv,
     * etc., without needing to rewrite Tcl_Main()
     */

#ifdef TCL_LOCAL_MAIN_HOOK
    extern int TCL_LOCAL_MAIN_HOOK _ANSI_ARGS_((int *argc, char ***argv));
#endif

    char *p;

    /*
     * Set up the default locale to be standard "C" locale so parsing is
     * performed correctly.







|








|







55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
     * file. The #if checks for that #define and uses Tcl_AppInit if it
     * doesn't exist.
     */

#ifndef TCL_LOCAL_APPINIT
#define TCL_LOCAL_APPINIT Tcl_AppInit
#endif
    extern int TCL_LOCAL_APPINIT (Tcl_Interp *interp);

    /*
     * The following #if block allows you to change how Tcl finds the startup
     * script, prime the library or encoding paths, fiddle with the argv,
     * etc., without needing to rewrite Tcl_Main()
     */

#ifdef TCL_LOCAL_MAIN_HOOK
    extern int TCL_LOCAL_MAIN_HOOK (int *argc, char ***argv);
#endif

    char *p;

    /*
     * Set up the default locale to be standard "C" locale so parsing is
     * performed correctly.