[Scummvm-devel] MSVC6 and the "restrict" keyword

Eugene Sandulenko sev at interhack.net
Fri Aug 27 12:36:01 CEST 2004


Max Horn writes:
 > > #ifndef __restrict__
 > > #define __restrict__
 > > #endif
 > >
 > > I placed this code at the top of scummvm/common/scaler/scale2x.cpp and
 > > scummvm/common/scaler/scale3x.cpp.
 > 
 > That patch won't work; the preprocessor is not aware of language  
 > keywords. The "proper" way is to check whether the compiler supports  
 > this keyword in the configure script or so...
The problem is that MSVC doesn't use configure script now. I think
that no compiler except that which we used till moment has problems
with __restrict__. So probably we could just add another define
HAVE_RESTRICT__ which is always set to true in config.h, but MSVC will
not use it.

With this approach above could would turn to:

#ifnded HAVE_RESTRICT__
#define __restrict__
#endif

Also I noted this problem with MSVC8, but maybe that's because of some
option I swithced in a wrong position.


Eugene




More information about the Scummvm-devel mailing list