From: SourceForge.net <no...@so...> - 2004-04-06 22:37:54
|
Feature Requests item #922727, was opened at 2004-03-24 16:02 Message generated for change (Comment added) made by dgp You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=360894&aid=922727&group_id=10894 Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 7 Submitted By: Don Porter (dgp) >Assigned to: Don Porter (dgp) Summary: Header reform Initial Comment: Over time it appears that the system of *.h files in Tcl have drifted away from the recommendations of the Engineering Manual. In particular, the subset relationship of tcl.h < tclInt.h < tclPort.h has emerged, rather than the tcl.h < tclPort.h < tclInt.h that the EM recommmends. This patch restores things to my understanding of the EM. It will require platform testing. After this patch, any C file will only need to #include one of the 3 header files, and should choose the "smallest" one that satisfies. This patch also removes old headers that no longer matter, and merges some that make things simpler. One implication of this patch is that any C file that wants to #include tclInt.h will need the ability to also #include tclPort.h and the suitable tcl(Unix/Win)Port.h to take care of the #include dependencies. The traditional access to tclInt.h within a Tcl source distribution is sufficient to take care of this. Requesting first review from the MacOSX maintainers. ---------------------------------------------------------------------- >Comment By: Don Porter (dgp) Date: 2004-04-06 18:37 Message: Logged In: YES user_id=80530 committed to HEAD (8.5a2) for additional testing. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2004-03-29 17:39 Message: Logged In: YES user_id=80530 tested patch, works on Unix and Win. Any additional Mac OS X comments? ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2004-03-29 16:00 Message: Logged In: YES user_id=80530 Updated patch. Thanks for testing. ---------------------------------------------------------------------- Comment By: Kevin B KENNY (kennykb) Date: 2004-03-29 15:23 Message: Logged In: YES user_id=99768 tclIOUtil.c needs: #ifdef __WIN32__ #include "tclWinInt.h" #endif near the head of the file. tclWinLoad.c and tclWinSock.c both need #include "tclWinInt.h" tclWinDde.c needs tclInt.h to get TCL_TSD_INIT. Were it not for that (for example, if the TCL_TSD_INIT calls were to be replaced with calls to Tcl_GetThreadSpecificData), it could make do with #define WIN32_LEAN_AND_MEAN #include <windows.h> tclWinReg.c needs tclInt.h for TclWinGetPlatformId - don't know how, offhand, to avoid that. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2004-03-29 14:12 Message: Logged In: YES user_id=80530 Here's a second attempt, incorporating the suggestions in the comments. Also, I changed both tclWinDde.c and tclWinReg.c to #include only tcl.h, in the hope that good packages should only need the public Tcl interface. If that's not true, patches to make it true would be welcome. Please test, especially on Windows. ---------------------------------------------------------------------- Comment By: Joe English (jenglish) Date: 2004-03-25 16:31 Message: Logged In: YES user_id=68433 The 2004-03-24 patch merges the contents of tclWinInt.h into tclWinPort.h. It might be worthwhile to keep these distinct. That would help distinguish C source files that are intended to be platform-independent from those that are Windows (/Unix/Mac)-specific. ---------------------------------------------------------------------- Comment By: Kevin B KENNY (kennykb) Date: 2004-03-25 15:18 Message: Logged In: YES user_id=99768 Per dgp's request, I changed the #include back, but added (in tclInt.decls) the declaration: # Added in 8.5 as part of rationalizing header files declare 29 win { TclFile TclWinMakeFile(HANDLE handle) } With that declaration in place, the compilation gets through tclPort.h without trouble. It still requires tclInt.h, nevertheless, to define the five symbols: 'TclpInitLock', 'TclpInitUnlock', 'TCL_TSD_INIT', 'LONG_MAX', and 'LONG_MIN'. ---------------------------------------------------------------------- Comment By: Kevin B KENNY (kennykb) Date: 2004-03-25 14:27 Message: Logged In: YES user_id=99768 Patch fails to compile on Windows-VC++. Changing line 15 of tclWinTime.c from #include "tclPort.h" to #include "tclInt.h" appears to fix the problem. No new regression test failures observed. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=360894&aid=922727&group_id=10894 |