|
From: Kevin W. <sw...@wo...> - 2005-09-27 20:24:38
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm trying to build a "universal binary" of Tile on Mac OS X, 10.4, with gcc 4. I've successfully compiled Tk, but during make, Tile returns these errors: In file included from ./macosx/aquaTheme.c:35: /Users/kevin/tk/macosx/tkMacOSXInt.h:154: error: syntax error before 'int'In file included from ./macosx/aquaTheme.c:35: /Users/kevin/tk/macosx/tkMacOSXInt.h:154: error: syntax error before 'int' /Users/kevin/tk/macosx/tkMacOSXInt.h:155: error: syntax error before 'void' /Users/kevin/tk/macosx/tkMacOSXInt.h:156: error: syntax error before 'int' /Users/kevin/tk/macosx/tkMacOSXInt.h:157: error: syntax error before 'void' /Users/kevin/tk/macosx/tkMacOSXInt.h:158: error: syntax error before 'int' /Users/kevin/tk/macosx/tkMacOSXInt.h:159: error: syntax error before 'WindowClass' /Users/kevin/tk/macosx/tkMacOSXInt.h:155: error: syntax error before 'void' /Users/kevin/tk/macosx/tkMacOSXInt.h:156: error: syntax error before 'int' /Users/kevin/tk/macosx/tkMacOSXInt.h:157: error: syntax error before 'void' /Users/kevin/tk/macosx/tkMacOSXInt.h:158: error: syntax error before 'int' /Users/kevin/tk/macosx/tkMacOSXInt.h:159: error: syntax error before 'WindowClass' ./macosx/aquaTheme.c: In function 'ButtonElementDraw': ./macosx/aquaTheme.c:199: warning: passing argument 7 of 'DrawThemeButton' makes integer from pointer without a cast ./macosx/aquaTheme.c: In function 'ButtonElementDraw': ./macosx/aquaTheme.c:199: warning: passing argument 7 of 'DrawThemeButton' makes integer from pointer without a cast ./macosx/aquaTheme.c: In function 'PopupArrowElementDraw': ./macosx/aquaTheme.c:423: warning: passing argument 7 of 'DrawThemeButton' makes integer from pointer without a cast ./macosx/aquaTheme.c:436: warning: passing argument 6 of 'DrawThemePopupArrow' makes integer from pointer without a cast ./macosx/aquaTheme.c: In function 'PopupArrowElementDraw': ./macosx/aquaTheme.c:423: warning: passing argument 7 of 'DrawThemeButton' makes integer from pointer without a cast ./macosx/aquaTheme.c:436: warning: passing argument 6 of 'DrawThemePopupArrow' makes integer from pointer without a cast ./macosx/aquaTheme.c: In function 'TreeHeaderElementDraw': ./macosx/aquaTheme.c:827: warning: passing argument 7 of 'DrawThemeButton' makes integer from pointer without a cast ./macosx/aquaTheme.c: In function 'TreeHeaderElementDraw': ./macosx/aquaTheme.c:827: warning: passing argument 7 of 'DrawThemeButton' makes integer from pointer without a cast lipo: can't open input file: /var/tmp//ccCejjQ3.out (No such file or directory) make: *** [aquaTheme.o] Error 1 Any idea what the problem might be? - -- Cheers, Kevin Walzer, PhD WordTech Software http://www.wordtech-software.com sw at wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDOap+JmdQs+6YVcoRArUeAJ4iTt5v6Nti8m3wyu/08t2acIGPvgCfZLKF WabT0jCJzpLBVYSy7MyXqm4= =lq4z -----END PGP SIGNATURE----- |
|
From: Joe E. <jen...@fl...> - 2005-09-27 20:49:24
|
Kevin Walzer wrote: > I'm trying to build a "universal binary" of Tile on Mac OS X, 10.4, with > gcc 4. I've successfully compiled Tk, but during make, Tile returns > these errors: > > In file included from ./macosx/aquaTheme.c:35: > /Users/kevin/tk/macosx/tkMacOSXInt.h:154: error: syntax error before > 'int'In file included from ./macosx/aquaTheme.c:35: > /Users/kevin/tk/macosx/tkMacOSXInt.h:154: error: syntax error before 'int' > > [ ... gobs of errors elided ... ] macosx/aquaTheme.c currently includes the following headers: | #include <Carbon/Carbon.h> | #include <tk.h> | #include <tkInt.h> | #include <tkMacOSX.h> | #include <tkMacOSXInt.h> | #include "tkTheme.h" Now I'm pretty sure that's the Wrong Thing -- it was arrived at by trial and error, by adding, deleting, and reordering the #includes until the file finally compiled on the machine I was using at the time -- but I don't know what the Right Thing is. Any advice from AquaTk gurus? aquaTheme.c needs the Carbon API(s), plus a couple routines from the platform-specific public Tk API (TkMacOSXGetDrawablePort and TkMacOSXWinBounds). What headers should be included, and in which order? --Joe English jen...@fl... |
|
From: Kevin W. <sw...@wo...> - 2005-09-28 02:46:24
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Joe, Daniel Steffen also mentioned on the Tcl-Mac list that he is preparing some additional updates to Tcl-Mac to address things like byte swapping in preparation for the transition to MacTel. After posting my earlier message, I also noticed some similar errors when I tried to compile tktreectrl as a universal binary. Perhaps once Daniel's new revisions are committed, that might address the issue. Cheers, Kevin Walzer, PhD WordTech Software http://www.wordtech-software.com sw at wordtech-software.com Joe English wrote: | Kevin Walzer wrote: | | |>I'm trying to build a "universal binary" of Tile on Mac OS X, 10.4, with |>gcc 4. I've successfully compiled Tk, but during make, Tile returns |>these errors: |> |>In file included from ./macosx/aquaTheme.c:35: |>/Users/kevin/tk/macosx/tkMacOSXInt.h:154: error: syntax error before |>'int'In file included from ./macosx/aquaTheme.c:35: |>/Users/kevin/tk/macosx/tkMacOSXInt.h:154: error: syntax error before 'int' |> |>[ ... gobs of errors elided ... ] | | | | macosx/aquaTheme.c currently includes the following headers: | | | #include <Carbon/Carbon.h> | | #include <tk.h> | | #include <tkInt.h> | | #include <tkMacOSX.h> | | #include <tkMacOSXInt.h> | | #include "tkTheme.h" | | | Now I'm pretty sure that's the Wrong Thing -- it was arrived at | by trial and error, by adding, deleting, and reordering the #includes | until the file finally compiled on the machine I was using at the time -- | but I don't know what the Right Thing is. | | Any advice from AquaTk gurus? aquaTheme.c needs the Carbon API(s), | plus a couple routines from the platform-specific public Tk API | (TkMacOSXGetDrawablePort and TkMacOSXWinBounds). What headers | should be included, and in which order? | | | | --Joe English | | jen...@fl... | | | ------------------------------------------------------- | This SF.Net email is sponsored by: | Power Architecture Resource Center: Free content, downloads, discussions, | and more. http://solutions.newsforge.com/ibmarch.tmpl | _______________________________________________ | Tktable-tile-dev mailing list | Tkt...@li... | https://lists.sourceforge.net/lists/listinfo/tktable-tile-dev | | -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDOgPOJmdQs+6YVcoRAnj0AJwN5SKApCdp0ZMz/V6nEHl/KtnFpACeMpr0 KttMqWY8lW/FXdJ31lacIoE= =E6eX -----END PGP SIGNATURE----- |
|
From: Daniel A. S. <st...@ic...> - 2005-09-29 00:00:46
|
Kevin, On 28/09/2005, at 12:46, Kevin Walzer wrote: > Daniel Steffen also mentioned on the Tcl-Mac list that he is preparing > some additional updates to Tcl-Mac to address things like byte swapping > in preparation for the transition to MacTel. sorry for not being more clear, my changes only concern a very small area of tcl HEAD in tclMacOSXFCmd.c, c.f. patch below; there is no global way to magically handle byte swapping issues like these, they can only be discovered by testing/debugging on an actual mactel box or by careful code inspection. For instance, I discovered the issues in tclMacOSXFCmd.c by reading the Apple Universal Binary Programming Guidelines: http://developer.apple.com/documentation/MacOSX/Conceptual/ universal_binary/ and seeing two issues mentioned that I remembered from originally writing the tclMacOSXFCmd.c code... There is no easier way than this unfortunately, and I would be wary of shipping any code to customers that has just been recompiled as universal without having gone through detailed testing on a transition kit, you'd be much better off having people run your existing binaries via Rosetta if you can't actually test on a mactel box before shipping. > After posting my earlier > message, I also noticed some similar errors when I tried to compile > tktreectrl as a universal binary. tktreectrl is part of Darwin in Tiger and as such has been built successfully on i386 (I doubt it has been tested in detail though), what issues are you seeing exactly? > Perhaps once Daniel's new revisions are committed, that might address > the issue. those changes certainly won't help with building a universal tktreectrl, as explained above > |>I'm trying to build a "universal binary" of Tile on Mac OS X, 10.4, > with > |>gcc 4. I've successfully compiled Tk, but during make, Tile returns > |>these errors: > |> > |>In file included from ./macosx/aquaTheme.c:35: > |>/Users/kevin/tk/macosx/tkMacOSXInt.h:154: error: syntax error before > |>'int'In file included from ./macosx/aquaTheme.c:35: > |>/Users/kevin/tk/macosx/tkMacOSXInt.h:154: error: syntax error before > 'int' > |> > |>[ ... gobs of errors elided ... ] it would be useful to track down further where this problem comes from, presumably you have tried building just for ppc with gcc4 and Tiger? otherwise this could be well a gcc4 or Tiger issue, tile may not have been built like that previously... > | macosx/aquaTheme.c currently includes the following headers: > | > | | #include <Carbon/Carbon.h> > | | #include <tk.h> > | | #include <tkInt.h> > | | #include <tkMacOSX.h> > | | #include <tkMacOSXInt.h> > | | #include "tkTheme.h" > | > | > | Now I'm pretty sure that's the Wrong Thing -- it was arrived at > | by trial and error, by adding, deleting, and reordering the #includes > | until the file finally compiled on the machine I was using at the > time -- > | but I don't know what the Right Thing is. > | > | Any advice from AquaTk gurus? aquaTheme.c needs the Carbon API(s), > | plus a couple routines from the platform-specific public Tk API > | (TkMacOSXGetDrawablePort and TkMacOSXWinBounds). What headers > | should be included, and in which order? it should be sufficient to just #include <tkMacOSXInt.h>, which itself includes tkInt.h, tkMacOSX.h, tkPort.h and Carbon.h (as you can easily determine by looking at the top of that file...) generally the rule should be that it is sufficient to include the most specific header file that you need for the APIs in question, with the header reform on HEAD reestablishing the order tk.h < tkPort.h < tkInt.h < tkMacOSXInt.h I'm not sure if you actually need anything from tkMacOSXInt.h from your description, note that any function declarations in that file are not in the stubs table, and are no longer exported from the Tk shared lib in 8.5 at all (due to use of MODULE_SCOPE). Cheers, Daniel -- ** Daniel A. Steffen ** "And now for something completely ** Dept. of Mathematics ** different" Monty Python ** Macquarie University ** <mailto:st...@ma...> ** NSW 2109 Australia ** <http://www.maths.mq.edu.au/~steffen/> Index: tclMacOSXFCmd.c =================================================================== RCS file: /cvsroot/tcl/tcl/macosx/tclMacOSXFCmd.c,v retrieving revision 1.4 diff -u -p -r1.4 tclMacOSXFCmd.c --- tclMacOSXFCmd.c 25 Jul 2005 20:48:34 -0000 1.4 +++ tclMacOSXFCmd.c 28 Sep 2005 22:53:06 -0000 @@ -5,6 +5,7 @@ * subcommands of the "file" command. * * Copyright (c) 2003 Tcl Core Team. + * * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -19,6 +20,8 @@ #include <sys/paths.h> #endif +#include <libkern/OSByteOrder.h> + /* * Constants for file attributes subcommand. Need to be kept in sync with * tclUnixFCmd.c ! @@ -46,9 +49,11 @@ static int Tcl_GetOSTypeFromObj(Tcl_Int static Tcl_Obj * Tcl_NewOSTypeStringObj(CONST OSType newOSType); enum { - kFinfoIsInvisible = 0x4000, + kIsInvisible = 0x4000, }; +#define kFinfoIsInvisible (OSSwapHostToBigConstInt16(kIsInvisible)) + typedef struct fileinfobuf { u_int32_t info_length; union { @@ -56,8 +61,9 @@ typedef struct fileinfobuf { u_int32_t type; u_int32_t creator; u_int16_t fdFlags; - u_int16_t location; - u_int32_t padding[4]; + u_int32_t location; + u_int16_t reserved; + u_int32_t extendedFileInfo[4]; } finder; off_t rsrcForkSize; } data __attribute__ ((packed)); @@ -115,7 +121,7 @@ TclMacOSXGetFileAttribute(interp, objInd return TCL_ERROR; } - memset(&alist, 0, sizeof(struct attrlist)); + bzero(&alist, sizeof(struct attrlist)); alist.bitmapcount = ATTR_BIT_MAP_COUNT; if (objIndex == MACOSX_RSRCLENGTH_ATTRIBUTE) { alist.fileattr = ATTR_FILE_RSRCLENGTH; @@ -134,10 +140,12 @@ TclMacOSXGetFileAttribute(interp, objInd switch (objIndex) { case MACOSX_CREATOR_ATTRIBUTE: - *attributePtrPtr = Tcl_NewOSTypeStringObj(finfo.data.finder.creator); + *attributePtrPtr = Tcl_NewOSTypeStringObj( + OSSwapBigToHostInt32(finfo.data.finder.creator)); break; case MACOSX_TYPE_ATTRIBUTE: - *attributePtrPtr = Tcl_NewOSTypeStringObj(finfo.data.finder.type); + *attributePtrPtr = Tcl_NewOSTypeStringObj( + OSSwapBigToHostInt32(finfo.data.finder.type)); break; case MACOSX_HIDDEN_ATTRIBUTE: *attributePtrPtr = Tcl_NewBooleanObj( @@ -206,7 +214,7 @@ TclMacOSXSetFileAttribute(interp, objInd return TCL_ERROR; } - memset(&alist, 0, sizeof(struct attrlist)); + bzero(&alist, sizeof(struct attrlist)); alist.bitmapcount = ATTR_BIT_MAP_COUNT; if (objIndex == MACOSX_RSRCLENGTH_ATTRIBUTE) { alist.fileattr = ATTR_FILE_RSRCLENGTH; @@ -224,33 +232,33 @@ TclMacOSXSetFileAttribute(interp, objInd } if (objIndex != MACOSX_RSRCLENGTH_ATTRIBUTE) { + OSType t; + int h; + switch (objIndex) { case MACOSX_CREATOR_ATTRIBUTE: - if (Tcl_GetOSTypeFromObj(interp, attributePtr, - &finfo.data.finder.creator) != TCL_OK) { + if (Tcl_GetOSTypeFromObj(interp, attributePtr, &t) != TCL_OK) { return TCL_ERROR; } + finfo.data.finder.creator = OSSwapHostToBigInt32(t); break; case MACOSX_TYPE_ATTRIBUTE: - if (Tcl_GetOSTypeFromObj(interp, attributePtr, - &finfo.data.finder.type) != TCL_OK) { + if (Tcl_GetOSTypeFromObj(interp, attributePtr, &t) != TCL_OK) { return TCL_ERROR; } + finfo.data.finder.type = OSSwapHostToBigInt32(t); break; - case MACOSX_HIDDEN_ATTRIBUTE: { - int hidden; - - if (Tcl_GetBooleanFromObj(interp,attributePtr,&hidden) != TCL_OK) { + case MACOSX_HIDDEN_ATTRIBUTE: + if (Tcl_GetBooleanFromObj(interp, attributePtr, &h) != TCL_OK) { return TCL_ERROR; } - if (hidden) { + if (h) { finfo.data.finder.fdFlags |= kFinfoIsInvisible; } else { finfo.data.finder.fdFlags &= ~kFinfoIsInvisible; } break; } - } result = setattrlist(native, &alist, &finfo.data, sizeof(finfo.data), 0); @@ -342,7 +350,7 @@ TclMacOSXCopyFileAttributes(src, dst, st struct attrlist alist; fileinfobuf finfo; - memset(&alist, 0, sizeof(struct attrlist)); + bzero(&alist, sizeof(struct attrlist)); alist.bitmapcount = ATTR_BIT_MAP_COUNT; alist.commonattr = ATTR_CMN_FNDRINFO; @@ -429,15 +437,19 @@ Tcl_GetOSTypeFromObj( string = Tcl_GetStringFromObj(objPtr, &length); Tcl_UtfToExternalDString(encoding, string, length, &ds); - if (Tcl_DStringLength(&ds) > sizeof(OSType)) { + if (Tcl_DStringLength(&ds) > 4) { Tcl_AppendResult(interp, "expected Macintosh OS type but got \"", string, "\": ", (char *) NULL); result = TCL_ERROR; } else { - memset(osTypePtr, 0, sizeof(OSType)); - memcpy(osTypePtr, Tcl_DStringValue(&ds), + char string[4] = {'\0','\0','\0','\0'}; + memcpy(string, Tcl_DStringValue(&ds), (size_t) Tcl_DStringLength(&ds)); + *osTypePtr = (OSType) string[0] << 24 | + (OSType) string[1] << 16 | + (OSType) string[2] << 8 | + (OSType) string[3]; } Tcl_DStringFree(&ds); Tcl_FreeEncoding(encoding); @@ -464,13 +476,16 @@ static Tcl_Obj * Tcl_NewOSTypeStringObj( CONST OSType newOSType) /* OSType used to initialize the new object. */ { - char string[sizeof(OSType)+1]; + char string[5]; Tcl_Obj *resultPtr; Tcl_DString ds; Tcl_Encoding encoding = Tcl_GetEncoding(NULL, "macRoman"); - memcpy(string, &newOSType, sizeof(OSType)); - string[sizeof(OSType)] = '\0'; + string[0] = (char) (newOSType >> 24); + string[1] = (char) (newOSType >> 16); + string[2] = (char) (newOSType >> 8); + string[3] = (char) (newOSType); + string[4] = '\0'; Tcl_ExternalToUtfDString(encoding, string, -1, &ds); resultPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); |