proper use of __attribute__((visibility("hidden")))

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I found the following #define artifact on http://gcc.gnu.org/wiki/Visibility.

This suggests that while the Microsoft standard requires an using/building concept, but gcc doesn't.

However, I've found an email on this newsgroup that suggests that the "using" code should see a macro that is empty, not "__attribute__ ((visibility("hidden")))".

Which is correct?


#ifdef _MSC_VER
  #ifdef BUILDING_DLL
    #define DLLEXPORT __declspec(dllexport)
  #else
    #define DLLEXPORT __declspec(dllimport)
  #endif
  #define DLLLOCAL
#else
  #ifdef HAVE_GCCVISIBILITYPATCH
    #define DLLEXPORT __attribute__ ((visibility("default")))
    #define DLLLOCAL __attribute__ ((visibility("hidden")))
  #else
    #define DLLEXPORT
    #define DLLLOCAL
  #endif
#endif


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux