#defining the restrict keyword

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Sven:

Given that the restrict keyword may be defined by default for other compilers than gcc (it is in gcc 

http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.1/gcc/Other-Builtins.html

wouldn't the following be better?

#ifndef restrict
#ifndef G_GNUC_RESTRICT
#if defined (__GNUC__) && (__GNUC__ >= 4)
#define G_GNUC_RESTRICT __restrict__
#else
#define G_GNUC_RESTRICT
#endif
#define restrict G_GNUC_RESTRICT
#endif
#endif

This appears to work in (the not yet patched in svn) yafr. 

------

Even better:

It appears that autoconf can take care of this in one fell swoop:

http://www.gnu.org/software/libtool/manual/autoconf/C-Compiler.html

See the Macro: AC_C_RESTRICT section.

Nicolas Robidoux
Laurentian University/Universite Laurentienne

_______________________________________________
Gegl-developer mailing list
Gegl-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer

[Index of Archives]     [Yosemite News]     [Yosemite Photos]     [gtk]     [GIMP Users]     [KDE]     [Gimp's Home]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux