public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
From: Roger Pack <rogerdpack2@gmail.com>
To: Ross Johnson <Ross.Johnson@homemail.com.au>
Cc: pthreads-win32@sourceware.org
Subject: Re: feature request: not need to specify PTW32_STATIC_LIB for static usage possible ?
Date: Thu, 31 Oct 2013 19:46:00 -0000	[thread overview]
Message-ID: <CAL1QdWdLGhGttZqYSjN=U0TBkc-NJx=sao9xpFYtVf3hgrZ2jA@mail.gmail.com> (raw)
In-Reply-To: <CAL1QdWck9rJaG6pQN8r28fJA293ydT1rw_EeLNfZafv1D7jMCA@mail.gmail.com>

On 2/20/13, Roger Pack <rogerdpack2@gmail.com> wrote:
>> Sounds like you wanted to address this to the list but I think you
>> replied only to me.
>
> oops, moving back on list...suggest the ML be modified so the default
> reply-to is the ML :)
>
>> In Linux, the usual 'static' qualifier on declarations controls
>> visibility, regardless of dynamic or static linking but is restricted to
>> a file (or perhaps more accurately a compilation unit). If this isn't
>> convenient then GCC 4 and above recognise __attribute__
>> ((visibility("hidden"))), and also "#pragma GCC visibility
>> push(hidden)/#pragma GCC visibility pop" for block coverage in e.g.
>> header files. Otherwise everything is visible by default.
>>
>> So I believe GNU can build a Windows dynamic or static library using the
>> merged pthread.c after adding 'static' qualifiers where necessary, but I
>> don't know off-hand if this works for MSVS. If it does, i.e. replace the
>> need for _declspec(export/import), then we probably have a solution.

I saw this the other day in a script that installs win32-pthreads:

for file in 'pthread.h' 'sched.h' 'semaphore.h'; do
  ed -s "$prefix/include/$file" <<< $'g/ __declspec (dllexport)/s///g\nw\nq'
  ed -s "$prefix/include/$file" <<< $'g/ __declspec (dllimport)/s///g\nw\nq'
done

I'll admit that it is a bit frustrating to have to do
 export CFLAGS=-DPTW32_STATIC_LIB
for anything that ends up using pthreads...

FWIW.
-roger-

  reply	other threads:[~2013-10-31 19:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-15 18:36 Roger Pack
2013-02-19  1:03 ` Ross Johnson
     [not found]   ` <CAL1QdWcyU76396H_RzXNBMAf7QFrmtC_Ab7ajC=TzG43QJm7fQ@mail.gmail.com>
     [not found]     ` <51242375.1070904@homemail.com.au>
2013-02-20 17:01       ` Roger Pack
2013-10-31 19:46         ` Roger Pack [this message]
2013-11-01  0:56           ` Ross Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAL1QdWdLGhGttZqYSjN=U0TBkc-NJx=sao9xpFYtVf3hgrZ2jA@mail.gmail.com' \
    --to=rogerdpack2@gmail.com \
    --cc=Ross.Johnson@homemail.com.au \
    --cc=pthreads-win32@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).