include/material.h: Fixed broken C support
- The aiGetMaterialFloat() and aiGetMaterialInteger() C preprocessor definitions were broken because: - They had a space before the opening parenthesis - Using material key definitions expanding 1 to argument into 3 breaks the invocation of macros expecting 5 parameterspull/3966/head
parent
bf82caba18
commit
170063643c
|
@ -1499,7 +1499,7 @@ ASSIMP_API C_ENUM aiReturn aiGetMaterialFloatArray(
|
||||||
ai_real *pOut,
|
ai_real *pOut,
|
||||||
unsigned int *pMax);
|
unsigned int *pMax);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#if 1 //def __cplusplus
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
/** @brief Retrieve a single float property with a specific key from the material.
|
/** @brief Retrieve a single float property with a specific key from the material.
|
||||||
|
@ -1520,7 +1520,7 @@ ASSIMP_API C_ENUM aiReturn aiGetMaterialFloatArray(
|
||||||
* @return Specifies whether the key has been found. If not, the output
|
* @return Specifies whether the key has been found. If not, the output
|
||||||
* float remains unmodified.*/
|
* float remains unmodified.*/
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
inline aiReturn aiGetMaterialFloat(const aiMaterial *pMat,
|
inline aiReturn aiGetMaterialFloat(const C_STRUCT aiMaterial *pMat,
|
||||||
const char *pKey,
|
const char *pKey,
|
||||||
unsigned int type,
|
unsigned int type,
|
||||||
unsigned int index,
|
unsigned int index,
|
||||||
|
@ -1530,8 +1530,8 @@ inline aiReturn aiGetMaterialFloat(const aiMaterial *pMat,
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// Use our friend, the C preprocessor
|
// Use our friend, the C preprocessor // The macro does not work with e.g. AI_MATKEY_OPACITY expanding into 3 args
|
||||||
#define aiGetMaterialFloat (pMat, type, index, pKey, pOut) \
|
#define aiGetMaterialFloat(pMat, type, index, pKey, pOut) \
|
||||||
aiGetMaterialFloatArray(pMat, type, index, pKey, pOut, NULL)
|
aiGetMaterialFloatArray(pMat, type, index, pKey, pOut, NULL)
|
||||||
|
|
||||||
#endif //!__cplusplus
|
#endif //!__cplusplus
|
||||||
|
@ -1548,7 +1548,7 @@ ASSIMP_API C_ENUM aiReturn aiGetMaterialIntegerArray(const C_STRUCT aiMaterial *
|
||||||
int *pOut,
|
int *pOut,
|
||||||
unsigned int *pMax);
|
unsigned int *pMax);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#if 1 //def __cplusplus
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
/** @brief Retrieve an integer property with a specific key from a material
|
/** @brief Retrieve an integer property with a specific key from a material
|
||||||
|
@ -1566,7 +1566,7 @@ inline aiReturn aiGetMaterialInteger(const C_STRUCT aiMaterial *pMat,
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// use our friend, the C preprocessor
|
// use our friend, the C preprocessor
|
||||||
#define aiGetMaterialInteger (pMat, type, index, pKey, pOut) \
|
#define aiGetMaterialInteger(pMat, type, index, pKey, pOut) \
|
||||||
aiGetMaterialIntegerArray(pMat, type, index, pKey, pOut, NULL)
|
aiGetMaterialIntegerArray(pMat, type, index, pKey, pOut, NULL)
|
||||||
|
|
||||||
#endif //!__cplusplus
|
#endif //!__cplusplus
|
||||||
|
|
Loading…
Reference in New Issue