Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Standardized Equivalent to __declspec(dllexport)?

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
4 posts • Page 1 of 1
Author
Message
wswartzendruber
Veteran
Veteran
User avatar
Posts: 1261
Joined: Tue Mar 23, 2004 1:16 am
Location: Idaho, USA

Standardized Equivalent to __declspec(dllexport)?

  • Quote

Post by wswartzendruber » Tue Oct 14, 2008 7:12 pm

I'm looking for a standardized way to achieve the results of __declspec(dllexport) with GCC on a POSIX environment.
Git has obsoleted SVN.
10mm Auto has obsoleted 45 ACP.
Top
Genone
Retired Dev
Retired Dev
User avatar
Posts: 9656
Joined: Fri Mar 14, 2003 6:02 pm
Location: beyond the rim

  • Quote

Post by Genone » Tue Oct 14, 2008 8:08 pm

There is no need for such a construct, see http://www.groupsrv.com/linux/about71257.html for details.
Top
Eckos
Apprentice
Apprentice
User avatar
Posts: 197
Joined: Fri Jan 25, 2008 4:14 pm
Location: Houston, Texas, USA
Contact:
Contact Eckos
Website

  • Quote

Post by Eckos » Tue Oct 14, 2008 9:42 pm

I have something like this in my code

#ifdef Q_CC_MSVC
#ifdef BUILD_DLL
#define DECL_EXPORT __declspec(dllexport)
#else
#define DECL_EXPORT __declspec(dllimport)
#endif
#elif Q_CC_UNIX
#define DECL_EXPORT
#endif
AMD Athlon 64 X2 3800+ | 2GB DDR2 533MHz RAM | GCC-4.3.2 | Gentoo x86_64 | KDE 4.1.2
Top
Hu
Administrator
Administrator
Posts: 24385
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Wed Oct 15, 2008 12:43 am

Any global scope variable with default visibility should be exported when a shared object is built. If you build with hidden visibility as a global setting, which you should do, then use __attribute__((visibility("default"))) to mark the symbol as having exported visibility. You may also be interesting in reading How To Write Shared Libraries by Ulrich Drepper.
Top
Post Reply

4 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic