bugGNUstep - Bugs: bug #35777, GSWeb build on Mac OS X fails due...

Group
 
 

bug #35777: GSWeb build on Mac OS X fails due to object_getClass()

Submitter:  Graham Lee <leeg>
Submitted:  Fri 09 Mar 2012 09:54:30 PM UTC
   
 
Category:  gsweb Severity:  3 - Normal
Item Group:  Bug Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 21 Dec 2013 07:14:50 AM UTC, comment #3: 

Is this still an issue?

Sebastian Reitenbach <buzzdee>
Group Member
Fri 11 May 2012 12:39:17 PM UTC, comment #2: 

I realised I confused things with the discussions about patches: the one at https://savannah.gnu.org/bugs/download.php?file_id=25312 works correctly. It's the patch in the submission comment that should be ignored. Sorry.

Graham Lee <leeg>
Sat 10 Mar 2012 04:17:00 AM UTC, comment #1: 

I made a mistake, the apple runtime does support object_getClass(), but the GSW source doesn't include the header for the function. The patch I attached shouldn't be used, and I'll create a new one.

Graham Lee <leeg>
Fri 09 Mar 2012 09:54:30 PM UTC, original submission:  

Building for apple-apple-apple fails with this error:

$ make
This is gnustep-make 2.6.2. Type 'make print-gnustep-make-help' for help.
Making all in GSWeb ...
Making build-headers for framework WebObjects...
Making all for framework WebObjects...
 Compiling file GSWConstants.m ...
In file included from GSWeb.h:176,
                 from GSWConstants.m:37:
GSWDynamicElement.h: In function ‘GSWDynamicElement_evaluateValueInContext’:
GSWDynamicElement.h:62: error: implicit declaration of function ‘object_getClass’
GSWDynamicElement.h:62: warning: comparison between pointer and integer
make[3]: * [obj/WebObjects/WebObjects.obj/GSWConstants.m.o] Error 1
make[2]: * [internal-framework-run-compile-submake] Error 2
make[1]: * [WebObjects.all.framework.variables] Error 2
make: * [internal-all] Error 2

On the new Apple Objective-C runtime, the API for getting a class (objc_getClass()) takes a name, not an instance. Therefore I've patched this by using the -class method, which should work with any Objective-C runtime.


Index: GSWeb/GSWDynamicElement.h
===================================================================
--- GSWeb/GSWDynamicElement.h (revision 34917)
+++ GSWeb/GSWDynamicElement.h (working copy)
@@ -58,8 +58,7 @@
 BOOL GSWDynamicElement_evaluateValueInContext(GSWDynamicElement* element,Class standardClass,
                                               GSWIMP_BOOL imp,GSWAssociation* condition,GSWContext* context)
 {
-  // was object_get_class
-  if (imp && object_getClass(element)==standardClass)
+  if (imp && ([element class]==standardClass))
     {
       return (*imp)(element,evaluateConditionInContextSEL,
                     condition,context);

Graham Lee <leeg>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #25312:  gsw-objc2runtime.patch added by leeg (1KiB - application/octet-stream - Patch to conditionally include Apple's objc header if the apple runtime is used)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by buzzdee (Posted a comment)
  • -email is unavailable- added by leeg (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-03-10 leeg Attached File- Added gsw-objc2runtime.patch, #25312

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code