Various patches against gmp-4.3.0

Michiel De Wilde mdewilde.agilent at googlemail.com
Wed May 6 10:38:48 CEST 2009


2009/5/6 Torbjorn Granlund tg at gmplib.org

> [... abour "#define restrict __restrict"]
> Sorry, I don't see why this reasoning is relevant to the present
> situation.  I repeat: gmp-impl.h is an internal GMP file.  Surely its
> "global" effects should be quite limited.  :-)
>
> I understand that
>
> #include "gmp.h"
> #include "gmp-impl.h"
> #include <somesystemheader.h>
>
> can be a problem.  Are you trying to say that we do that in GMP?


The autoconf defines are performed before including system files. See the
failed config test below.


> If you, as I suspect, are playing with GMP's internal interfaces, you're
> onn your own.
>
  [...]
> Ah, so you *are* playing with GMP internals.  Sorry, there are very good
> reasons for not trying to make that easier.


We have no interest in abusing gmp internals. All we want to do is to make
"make check" work, as advised on the GMP website. There's no reason to be
offended.
This official gmp testing code accesses the functions in gmp-impl.h. If you
don't __declspec(dllexport) tehse functions, gmp's own tests won't work.

As for hiding internal functions: the gmp-impl.h file is not installed, so
people can't directly call these functions anyway. Having them in the dll is
not a big clutter, and it allows the dll to be tested with gmp's own "make
check".

Kind regards,

Michiel

==

configure: failed program was:
| /* confdefs.h.  */
|
| #define PACKAGE_NAME "GNU MP"
| #define PACKAGE_TARNAME "gmp"
| #define PACKAGE_VERSION "4.3.0"
| #define PACKAGE_STRING "GNU MP 4.3.0"
| #define PACKAGE_BUGREPORT "gmp-bugs at swox.com"
| #define PACKAGE "gmp"
| #define VERSION "4.3.0"
| #define WANT_ASSERT 1
| #define WANT_FFT 1
| #define HAVE_HOST_CPU_x86 1
| #ifdef __cplusplus
| void exit (int);
| #endif
| #define PROTOTYPES 1
| #define __PROTOTYPES 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRING_H 1
| #define STDC_HEADERS 1
| #define HAVE_FCNTL_H 1
| #define HAVE_FLOAT_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_DECL_FGETC 1
| #define HAVE_DECL_FSCANF 1
| #define HAVE_DECL_OPTARG 0
| #define HAVE_DECL_UNGETC 1
| #define HAVE_DECL_VFPRINTF 1
| #define HAVE_DECL_SYS_ERRLIST 0
| #define HAVE_DECL_SYS_NERR 0
| #define RETSIGTYPE void
| #define HAVE_LONG_DOUBLE 1
| #define HAVE_LONG_LONG 1
| #define HAVE_PTRDIFF_T 1
| #define HAVE_STRINGIZE 1
| #define restrict __restrict
| #define HAVE_STDARG 1
| #ifndef __cplusplus
| #define inline __inline
| #endif
| /* end confdefs.h.  */
| #include <alloca.h>
| int
| main ()
| {
| char *p = (char *) alloca (2 * sizeof (int));
|   ;
|   return 0;
| }
configure:27006: result: no
configure:27017: checking for alloca (via gmp-impl.h)
configure:27046: cl -o conftest.exe    /Zi /D_CRT_SECURE_NO_WARNINGS
/D_CRT_NONSTDC_NO_WARNINGS /D_USE_32BIT_TIME_T  /W4  /nologo /Dfar=far_p
/Dnear=near_p
/Fdc:/users/default/ads/gmp/debug/build/obj.win32/gmp_dist/gmp_dist.pdb /TC
/MDd /Zi /D _DEBUG /GS /RTC1 -DQT_DEBUG
/Ic:/users/default/ads/gmp/debug/build/projects/gmp_dist
/Ic:/users/default/ads/gmp/debug/build/include
/IS:/hped/builds/gent/devXXX/rmom_int/debug/build/include   /D_AFXDLL
/DNO_MALLOC_MACRO /DWIN32 /D_WIN32 /U_WINDOWS /DWINVER=0x0500 /D_MBCS
-DQT_DEBUG /D_DLL_BUILD  -DVER="351" -DREV="mom_int" -DPROD_IS_de
/Ic:/users/default/ads/gmp/debug/build/include
/IS:/hped/builds/gent/devXXX/rmom_int/debug/build/include  conftest.c /link
/nologo /MANIFEST /debug  /LIBPATH:.
/LIBPATH:c:/users/default/ads/gmp/debug/build/lib.win32
/LIBPATH:S:/hped/builds/gent/devXXX/rmom_int/debug/build/lib.win32
stlport_vc_debug.lib  WSock32.lib user32.lib advapi32.lib comdlg32.lib
gdi32.lib netapi32.lib comctl32.lib winspool.lib >&5
conftest.c
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\malloc.h(117) : error
C2485: '__restrict' : unrecognized extended attribute
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\malloc.h(119) : error
C2485: '__restrict' : unrecognized extended attribute
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\malloc.h(120) : error
C2485: '__restrict' : unrecognized extended attribute
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\malloc.h(121) : error
C2485: '__restrict' : unrecognized extended attribute
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\malloc.h(123) : error
C2485: '__restrict' : unrecognized extended attribute
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\malloc.h(124) : error
C2485: '__restrict' : unrecognized extended attribute
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\malloc.h(125) : error
C2485: '__restrict' : unrecognized extended attribute
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\malloc.h(126) : error
C2485: '__restrict' : unrecognized extended attribute
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\malloc.h(127) : error
C2485: '__restrict' : unrecognized extended attribute
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\malloc.h(128) : error
C2485: '__restrict' : unrecognized extended attribute
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gmplib.org/list-archives/gmp-devel/attachments/20090506/c64ec714/attachment-0001.html>


More information about the gmp-devel mailing list