bugGNUstep - Bugs: bug #34453, linking against C functions like...

Group
 
 

bug #34453: linking against C functions like NSRunAlertPanel() from ObjC++ fails

Submitter:  julian <julian_>
Submitted:  Sat 01 Oct 2011 07:04:02 PM UTC
   
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 04 Oct 2011 01:40:49 PM UTC, comment #3: 

Committed your patch.

Fred Kiefer <FredKiefer>
Group Member
Tue 04 Oct 2011 11:34:43 AM UTC, comment #2: 

thanks, i can confirm the fix works.

i've also wrapped the other cases in GUI where this is needed, see attached patch.

all C functions in BASE were already wrapped.

(file #24095)

julian <julian_>
Tue 04 Oct 2011 06:00:00 AM UTC, comment #1: 

I guess this is the trivial case of needing to wrap declarations for C++ code

I modified NSPanel.h with:

#if     defined(__cplusplus)
extern "C" {
#endif


#if     defined(__cplusplus)
}
#endif

Hopefully that fixes it (though it may be needed for other headers.

Richard Frith-Macdonald <CaS>
Group Member
Sat 01 Oct 2011 07:04:02 PM UTC, original submission:  

linking against C functions like NSRunAlertPanel() from ObjC++ source files fails, although using the Obj-C based API works fine. error occurs on current clang SVN trunk, didn't try gcc.

trivial testcase attached.

julian <julian_>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #24095:  cplusplus.diff added by julian_ (2KiB - application/octet-stream)
file #24071:  test.tar.gz added by julian_ (795B - application/x-gzip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by FredKiefer (Posted a comment)
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by julian_ (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.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-10-04 FredKiefer Open/ClosedIn Test Closed
    2011-10-04 julian_ Attached File- Added cplusplus.diff, #24095
    2011-10-04 CaS CategoryNone Gui/AppKit
        StatusNone Fixed
        Open/ClosedOpen In Test
    2011-10-01 julian_ Attached File- Added test.tar.gz, #24071

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code