Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#3 Fix compile problem on BeOS

closed-accepted
None
5
2001-03-01
2001-02-03
Sam TH
No

Using __attribute__ only works on Windows machines, but BeOS defines __declspec.

Discussion

  • Sam TH
    Sam TH
    2001-02-03

    None

     
    Attachments
    • assigned_to: nobody --> fdrake
     
  • Logged In: YES
    user_id=3066

    Checked in as lib/expat.h.in revision 1.3.

    Sam, can you tell us how __declspec *is* used on BeOS, and why it's different from the Windows use? I couldn't find it searching be.com or in the index of the O'Reilly book I have on BeOS (unread since I don't have a BeOS box).

    Thanks!

     
    • status: open --> closed-accepted
     
  • Sam TH
    Sam TH
    2001-03-02

    Logged In: YES
    user_id=48667

    I'm pretty sure it uses it to declare symbols as public,
    which is the way windows uses it AFAIK. I don't develop on
    either system, but the definition was causing syntax errors
    on BeOS machines I was building on.

    Wait, I have discovered the source of the error. It's GCC
    (which is the compiler I was using) that was failing to
    understand __declspec properly. Most likely, if the
    Metroworks compiler was used, __declspec would be
    understood, and shared libs would be properly generated. It
    seems neither is possible with GCC.

    The solution seems to be to add an #ifdef for GNU C, instead
    of just for BeOS.

    Reference:
    http://www.bespecific.com/dialog/bedevtalk/archive/980315/0155.html