delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/03/03/11:20:29

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Date: Wed, 3 Mar 1999 11:19:18 -0500
Message-Id: <199903031619.LAA28028@envy.delorie.com>
X-Authentication-Warning: envy.delorie.com: dj set sender to dj AT envy DOT delorie DOT com using -f
From: DJ Delorie <dj AT delorie DOT com>
To: tjh AT quadstone DOT com
CC: cygwin AT sourceware DOT cygnus DOT com
In-reply-to: <36DD41B4.BF1C00D7@quadstone.com> (message from T J Harding on
Wed, 03 Mar 1999 14:05:40 +0000)
Subject: Re: How to handle variables (data, etc.) in DLLs?
References: <36DD41B4 DOT BF1C00D7 AT quadstone DOT com>

DLLs *can't* export "data".  They can only export pointers to data,
which is what they do.  In older gccs, you'll need to do something
like this:

extern int *__imp_foo;
#define foo (*__imp_foo)

In newer gccs, do something like this:

extern int foo __attribute__((dllimport));

These tell gcc to dereference the imported pointer, rather than
thinking it's the data itself.

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019