On Wednesday, April 2, 2014 8:21:16 AM UTC+2, Jean-Pierre Flori wrote: > > > > On Wednesday, April 2, 2014 1:47:30 AM UTC+2, Bill Hart wrote: >> >> All the C tests pass now. Just checking the C++ ones. >> >> >> On 2 April 2014 00:49, Bill Hart <goodwi...@googlemail.com> wrote: >> >>> Got it! >>> >>> /* __GMP_DECLSPEC supports Windows DLL versions of libmpir, and is empty >>> in >>> all other circumstances. >>> >>> When compiling objects for libmpir, __GMP_DECLSPEC is an export >>> directive, >>> or when compiling for an application it's an import directive. The >>> two >>> cases are differentiated by __GMP_WITHIN_GMP defined by the GMP >>> Makefiles >>> (and not defined from an application). >>> >>> __GMP_DECLSPEC_XX is similarly used for libmpirxx. __GMP_WITHIN_GMPXX >>> indicates when building libmpirxx, and in that case libmpirxx >>> functions are >>> exports, but libmpir functions which might get called are imports. >>> >>> libmp.la uses __GMP_DECLSPEC, just as if it were libmpir.la. >>> libmpir and >>> libmp don't call each other, so there's no conflict or confusion. >>> >>> Libtool DLL_EXPORT define is not used. >>> >>> There's no attempt to support GMP built both static and DLL. Doing so >>> would mean applications would have to tell us which of the two is >>> going >>> to be used when linking, and that seems very tedious and error prone >>> if >>> using GMP by hand, and equally tedious from a package since autoconf >>> and >>> automake don't give much help. >>> >>> __GMP_DECLSPEC is required on all documented global functions and >>> variables, the various internals in gmp-impl.h etc can be left >>> unadorned. >>> But internals used by the test programs or speed measuring programs >>> should have __GMP_DECLSPEC, and certainly constants or variables must >>> have it or the wrong address will be resolved. >>> >>> In gcc __declspec can go at either the start or end of a prototype. >>> >>> In Microsoft C __declspec must go at the start, or after the type like >>> void __declspec(...) *foo()". There's no __dllexport or anything to >>> guard against someone foolish #defining dllexport. _export used to be >>> available, but no longer. >>> */ >>> >>> >>> >>> Great! > > By the way, this looks quite interesting: > http://www.cygwin.com/ml/cygwin/2002-01/msg00236.html > > Maybe we could just get rid of the dllexport/import nightmare? at least on > Cygwin (and MinGW?). > FTR: https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Using_ld_the_GNU_Linker/win32.html
-- You received this message because you are subscribed to the Google Groups "mpir-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to mpir-devel+unsubscr...@googlegroups.com. To post to this group, send email to mpir-devel@googlegroups.com. Visit this group at http://groups.google.com/group/mpir-devel. For more options, visit https://groups.google.com/d/optout.