1
1

Per the lengthy discussion on this thread:

http://www.open-mpi.org/community/lists/users/2009/03/8402.php

Just #define away restrict in C++ because we don't have an
AC_CXX_RESTRICT test to see what the C++ compilers needs to support
"restrict".

This commit was SVN r20792.
Этот коммит содержится в:
Jeff Squyres 2009-03-16 21:09:54 +00:00
родитель 27bacbee3c
Коммит 7ec52bc5a4

Просмотреть файл

@ -571,18 +571,13 @@ static inline uint16_t ntohs(uint16_t netvar) { return netvar; }
#endif
/*
* The following is a workaround for a workaround in autoconf for the
* Sun Studio C++ compiler. The Sun Studio C++ compiler does not
* support restrict whereas the Sun Studio C compiler does. Initially,
* Sun Studio C only supported _Restrict, but later version started
* supporting __restrict__ also. Currently, autoconf handles turning
* off _Restrict but not __restrict__ for the Sun Studio C++ compiler.
* Therefore, we are handling it here. When autoconf gets fixed, this
* code can be removed.
*/
#if defined __SUNPRO_CC && !defined __RESTRICT
# define __restrict__
/* If we're in C++, then just undefine restrict and then define it to
nothing. "restrict" is not part of the C++ language, and we don't
have a corresponding AC_CXX_RESTRICT to figure out what the C++
compiler supports. */
#if defined(c_plusplus) || defined(__cplusplus)
#undef restrict
#define restrict
#endif
#endif /* OMPI_BUILDING */