--- ray/src/common/bsdf.h 2016/02/03 01:54:51 2.23 +++ ray/src/common/bsdf.h 2018/01/05 20:15:50 2.25 @@ -1,4 +1,4 @@ -/* RCSid $Id: bsdf.h,v 2.23 2016/02/03 01:54:51 greg Exp $ */ +/* RCSid $Id: bsdf.h,v 2.25 2018/01/05 20:15:50 schorsch Exp $ */ /* * bsdf.h * @@ -25,15 +25,12 @@ #include "fvect.h" #include "ccolor.h" +#include "platform.h" #ifdef __cplusplus extern "C" { #endif -#ifdef _WIN32 -#define strcasecmp stricmp -#endif - #define SDnameLn 128 /* maximum BSDF name length */ #define SDmaxCh 3 /* maximum # spectral channels */ @@ -87,7 +84,14 @@ extern const SDCDst SDemptyCD; /* empty distribution * typedef struct SDComp_s SDComponent; /* Methods needed to handle BSDF components (nothing is optional) */ +#ifdef __cplusplus +/* in C++, the const puts the type into the local anonymous namespace, + making it a private (and different) type for each file using this header. +*/ +typedef struct { +#else typedef const struct { +#endif /* return non-diffuse BSDF */ int (*getBSDFs)(float coef[SDmaxCh], const FVECT outVec, const FVECT inVec, SDComponent *sdc);