This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
RE: WIN-02: get boehm-gc autodetect if it is compiled as a DLL
- From: "Boehm, Hans" <hans_boehm at hp dot com>
- To: "'Adam Megacz'" <patches at lists dot megacz dot com>, java-patches at gcc dot gnu dot org
- Date: Thu, 31 Jan 2002 10:50:35 -0800
- Subject: RE: WIN-02: get boehm-gc autodetect if it is compiled as a DLL
Adam -
I'm not sure the first part of this does much, though it may be a minor
improvement over what's there. The collector currently provides win32
thread support only if the GC is built as a DLL, since it relies on the DLL
attach messages to find out about thread creations. (For gcj, there are
probably other possible solutions; I'm not sure exactly what you ended up
doing.) Thus GC_WIN32_THREADS normally implies the collector is built as a
DLL. But the converse shouldn't necessarily be true.
What are the semantics of _DLL? With some of the Microsoft tools, I thought
that's sometimes set even if you're just linking against a dynamic libc
etc.? That's the reason for the funny GC_NOT_DLL tests. I didn't think it
was set only if you're building a DLL. (If it were, the dllimport side of
this wouldn't work.)
Should the first test just be
#if defined(__MINGW32__) && defined(_DLL) && !defined(GC_NOT_DLL)
?
I don't understand the second part of the patch. At a minimum, the second
test on _DLL is redundant. And this should only be relevant for the Digital
Mars or MS compilers?
Hans
> -----Original Message-----
> From: Adam Megacz [mailto:patches@lists.megacz.com]
> Sent: Thursday, January 31, 2002 1:32 AM
> To: java-patches@gcc.gnu.org
> Subject: WIN-02: get boehm-gc autodetect if it is compiled as a DLL
>
>
>
> 2002-01-31 Adam Megacz <adam@xwt.org>
>
> * boehm-gc on win32 now automatically detects if it is being
> built as a DLL; see
> http://gcc.gnu.org/ml/java/2001-12/msg00240.html
>
>
> *** gc.h Fri Jan 25 10:06:23 2002
> --- gc.h Thu Jan 31 01:20:15 2002
> ***************
> *** 86,92 ****
> typedef long ptrdiff_t; /* ptrdiff_t is not defined */
> # endif
>
> ! #if defined(__MINGW32__) && defined(GC_WIN32_THREADS)
> # ifdef GC_BUILD
> # define GC_API __declspec(dllexport)
> # else
> --- 86,92 ----
> typedef long ptrdiff_t; /* ptrdiff_t is not defined */
> # endif
>
> ! #if defined(__MINGW32__) && defined(GC_WIN32_THREADS) &&
> defined(_DLL)
> # ifdef GC_BUILD
> # define GC_API __declspec(dllexport)
> # else
> ***************
> *** 95,101 ****
> #endif
>
> #if (defined(__DMC__) || defined(_MSC_VER)) \
> ! && (defined(_DLL) && !defined(GC_NOT_DLL) \
> || defined(GC_DLL))
> # ifdef GC_BUILD
> # define GC_API extern __declspec(dllexport)
> --- 95,101 ----
> #endif
>
> #if (defined(__DMC__) || defined(_MSC_VER)) \
> ! && (defined(_DLL) && defined(_DLL) \
> || defined(GC_DLL))
> # ifdef GC_BUILD
> # define GC_API extern __declspec(dllexport)
>
>
>