#224 _cstddef.h needs to include errno.h for MSVC

5.2
open
nobody
5
2009-11-23
2009-11-23
No

On MSVC 8.0 (Visual Studio 2005), compilation in debug mode fails with
stlport/errno.h(55) : fatal error C1189: #error : errno has been defined before inclusion of errno.h header.

This is due to inclusion of native cstddef from stlport/stl/_cstdef.h
A fix that I found is to preface this inclusion withe the same fix as done in stlport/stddef.h

#if defined (_MSC_VER) || defined (__DMC__)
/* Native stddef.h contains errno macro definition making inclusion of native
* errno.h in STLport errno.h impossible. We are then forced to include errno.h
* first.
*/
# include "errno.h"
#endif

Please can you verify that this is the optimal way to fix it.

Thank you

Discussion