Various patches against gmp-4.3.0
nisse at lysator.liu.se
Wed May 6 10:08:42 CEST 2009
Michiel De Wilde <mdewilde.agilent at googlemail.com> writes:
> A #define always changes a name on a global scope level. On Windows, some
> win32 headers that get included use __declspec(restrict), which is now
> changed to __declspec(__restrict), which is invalid. The problem does not
> occur if you include the project name into the identifier that is being
> redefined: "#define GMP_RESTRICT __restrict" instead of "#define restrict
> __restrict" (and replace "restrict" by "GMP_RESTRICT" in the code).
This is still confusing. As long as the windows headers and the gmp
redefinition of restrict are not included in the same compilation
unit, there should be no problem, right? In which compilation unit do
you include both gmp's redefinition, and windows headers?
It's common practice in autoconf projects to redefine C keywords when
necessary, and to do, e.g.,
#define GMP_CONST const
This reduces clutter in the code that uses the keyword.
More information about the gmp-devel