From d676e1a13f63f99219c74bc43001a7705484b6f9 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 5 Oct 2020 21:37:18 +0200 Subject: [PATCH] closes https://github.com/assimp/assimp/issues/3379: reproduce error of unresolved symbol with static lib --- include/assimp/cimport.h | 445 +++++++++++++++++----------------- include/assimp/importerdesc.h | 6 +- test/unit/AssimpAPITest.cpp | 17 +- 3 files changed, 234 insertions(+), 234 deletions(-) diff --git a/include/assimp/cimport.h b/include/assimp/cimport.h index 3e1b75a31..c68ca2d53 100644 --- a/include/assimp/cimport.h +++ b/include/assimp/cimport.h @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2020, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -49,19 +47,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_ASSIMP_H_INC #ifdef __GNUC__ -# pragma GCC system_header +#pragma GCC system_header #endif -#include #include +#include #ifdef __cplusplus extern "C" { #endif -struct aiScene; // aiScene.h -struct aiFileIO; // aiFileIO.h -typedef void (*aiLogStreamCallback)(const char* /* message */, char* /* user */); +struct aiScene; +struct aiFileIO; + +typedef void (*aiLogStreamCallback)(const char * /* message */, char * /* user */); // -------------------------------------------------------------------------------- /** C-API: Represents a log stream. A log stream receives all log messages and @@ -70,16 +69,14 @@ typedef void (*aiLogStreamCallback)(const char* /* message */, char* /* user */) * @see aiAttachLogStream * @see aiDetachLogStream */ // -------------------------------------------------------------------------------- -struct aiLogStream -{ +struct aiLogStream { /** callback to be called */ aiLogStreamCallback callback; /** user data to be passed to the callback */ - char* user; + char *user; }; - // -------------------------------------------------------------------------------- /** C-API: Represents an opaque set of settings to be used during importing. * @see aiCreatePropertyStore @@ -91,7 +88,9 @@ struct aiLogStream * @see aiSetPropertyMatrix */ // -------------------------------------------------------------------------------- -struct aiPropertyStore { char sentinel; }; +struct aiPropertyStore { + char sentinel; +}; /** Our own C boolean type */ typedef int aiBool; @@ -115,9 +114,9 @@ typedef int aiBool; * #aiPostProcessSteps flags. * @return Pointer to the imported data or NULL if the import failed. */ -ASSIMP_API const C_STRUCT aiScene* aiImportFile( - const char* pFile, - unsigned int pFlags); +ASSIMP_API const C_STRUCT aiScene *aiImportFile( + const char *pFile, + unsigned int pFlags); // -------------------------------------------------------------------------------- /** Reads the given file using user-defined I/O functions and returns @@ -140,10 +139,10 @@ ASSIMP_API const C_STRUCT aiScene* aiImportFile( * @return Pointer to the imported data or NULL if the import failed. * @note Include for the definition of #aiFileIO. */ -ASSIMP_API const C_STRUCT aiScene* aiImportFileEx( - const char* pFile, - unsigned int pFlags, - C_STRUCT aiFileIO* pFS); +ASSIMP_API const C_STRUCT aiScene *aiImportFileEx( + const char *pFile, + unsigned int pFlags, + C_STRUCT aiFileIO *pFS); // -------------------------------------------------------------------------------- /** Same as #aiImportFileEx, but adds an extra parameter containing importer settings. @@ -161,11 +160,11 @@ ASSIMP_API const C_STRUCT aiScene* aiImportFileEx( * @note Include for the definition of #aiFileIO. * @see aiImportFileEx */ -ASSIMP_API const C_STRUCT aiScene* aiImportFileExWithProperties( - const char* pFile, - unsigned int pFlags, - C_STRUCT aiFileIO* pFS, - const C_STRUCT aiPropertyStore* pProps); +ASSIMP_API const C_STRUCT aiScene *aiImportFileExWithProperties( + const char *pFile, + unsigned int pFlags, + C_STRUCT aiFileIO *pFS, + const C_STRUCT aiPropertyStore *pProps); // -------------------------------------------------------------------------------- /** Reads the given file from a given memory buffer, @@ -198,11 +197,11 @@ ASSIMP_API const C_STRUCT aiScene* aiImportFileExWithProperties( * a custom IOSystem to make Assimp find these files and use * the regular aiImportFileEx()/aiImportFileExWithProperties() API. */ -ASSIMP_API const C_STRUCT aiScene* aiImportFileFromMemory( - const char* pBuffer, - unsigned int pLength, - unsigned int pFlags, - const char* pHint); +ASSIMP_API const C_STRUCT aiScene *aiImportFileFromMemory( + const char *pBuffer, + unsigned int pLength, + unsigned int pFlags, + const char *pHint); // -------------------------------------------------------------------------------- /** Same as #aiImportFileFromMemory, but adds an extra parameter containing importer settings. @@ -232,12 +231,12 @@ ASSIMP_API const C_STRUCT aiScene* aiImportFileFromMemory( * the regular aiImportFileEx()/aiImportFileExWithProperties() API. * @see aiImportFileFromMemory */ -ASSIMP_API const C_STRUCT aiScene* aiImportFileFromMemoryWithProperties( - const char* pBuffer, - unsigned int pLength, - unsigned int pFlags, - const char* pHint, - const C_STRUCT aiPropertyStore* pProps); +ASSIMP_API const C_STRUCT aiScene *aiImportFileFromMemoryWithProperties( + const char *pBuffer, + unsigned int pLength, + unsigned int pFlags, + const char *pHint, + const C_STRUCT aiPropertyStore *pProps); // -------------------------------------------------------------------------------- /** Apply post-processing to an already-imported scene. @@ -254,9 +253,9 @@ ASSIMP_API const C_STRUCT aiScene* aiImportFileFromMemoryWithProperties( * the #aiProcess_ValidateDataStructure flag is currently the only post processing step * which can actually cause the scene to be reset to NULL. */ -ASSIMP_API const C_STRUCT aiScene* aiApplyPostProcessing( - const C_STRUCT aiScene* pScene, - unsigned int pFlags); +ASSIMP_API const C_STRUCT aiScene *aiApplyPostProcessing( + const C_STRUCT aiScene *pScene, + unsigned int pFlags); // -------------------------------------------------------------------------------- /** Get one of the predefine log streams. This is the quick'n'easy solution to @@ -279,8 +278,8 @@ ASSIMP_API const C_STRUCT aiScene* aiApplyPostProcessing( * @return The log stream. callback is set to NULL if something went wrong. */ ASSIMP_API C_STRUCT aiLogStream aiGetPredefinedLogStream( - C_ENUM aiDefaultLogStream pStreams, - const char* file); + C_ENUM aiDefaultLogStream pStreams, + const char *file); // -------------------------------------------------------------------------------- /** Attach a custom log stream to the libraries' logging system. @@ -293,7 +292,7 @@ ASSIMP_API C_STRUCT aiLogStream aiGetPredefinedLogStream( * Alternatively (for the lazy folks) #aiDetachAllLogStreams is provided. */ ASSIMP_API void aiAttachLogStream( - const C_STRUCT aiLogStream* stream); + const C_STRUCT aiLogStream *stream); // -------------------------------------------------------------------------------- /** Enable verbose logging. Verbose logging includes debug-related stuff and @@ -314,7 +313,7 @@ ASSIMP_API void aiEnableVerboseLogging(aiBool d); * @see aiDetachAllLogStreams */ ASSIMP_API C_ENUM aiReturn aiDetachLogStream( - const C_STRUCT aiLogStream* stream); + const C_STRUCT aiLogStream *stream); // -------------------------------------------------------------------------------- /** Detach all active log streams from the libraries' logging system. @@ -333,7 +332,7 @@ ASSIMP_API void aiDetachAllLogStreams(void); * @param pScene The imported data to release. NULL is a valid value. */ ASSIMP_API void aiReleaseImport( - const C_STRUCT aiScene* pScene); + const C_STRUCT aiScene *pScene); // -------------------------------------------------------------------------------- /** Returns the error text of the last failed import process. @@ -342,7 +341,7 @@ ASSIMP_API void aiReleaseImport( * import process. NULL if there was no error. There can't be an error if you * got a non-NULL #aiScene from #aiImportFile/#aiImportFileEx/#aiApplyPostProcessing. */ -ASSIMP_API const char* aiGetErrorString(void); +ASSIMP_API const char *aiGetErrorString(void); // -------------------------------------------------------------------------------- /** Returns whether a given file extension is supported by ASSIMP @@ -352,7 +351,7 @@ ASSIMP_API const char* aiGetErrorString(void); * @return AI_TRUE if the file extension is supported. */ ASSIMP_API aiBool aiIsExtensionSupported( - const char* szExtension); + const char *szExtension); // -------------------------------------------------------------------------------- /** Get a list of all file extensions supported by ASSIMP. @@ -363,7 +362,7 @@ ASSIMP_API aiBool aiIsExtensionSupported( * Format of the list: "*.3ds;*.obj;*.dae". NULL is not a valid parameter. */ ASSIMP_API void aiGetExtensionList( - C_STRUCT aiString* szOut); + C_STRUCT aiString *szOut); // -------------------------------------------------------------------------------- /** Get the approximated storage required by an imported asset @@ -371,10 +370,8 @@ ASSIMP_API void aiGetExtensionList( * @param in Data structure to be filled. */ ASSIMP_API void aiGetMemoryRequirements( - const C_STRUCT aiScene* pIn, - C_STRUCT aiMemoryInfo* in); - - + const C_STRUCT aiScene *pIn, + C_STRUCT aiMemoryInfo *in); // -------------------------------------------------------------------------------- /** Create an empty property store. Property stores are used to collect import @@ -382,13 +379,13 @@ ASSIMP_API void aiGetMemoryRequirements( * @return New property store. Property stores need to be manually destroyed using * the #aiReleasePropertyStore API function. */ -ASSIMP_API C_STRUCT aiPropertyStore* aiCreatePropertyStore(void); +ASSIMP_API C_STRUCT aiPropertyStore *aiCreatePropertyStore(void); // -------------------------------------------------------------------------------- /** Delete a property store. * @param p Property store to be deleted. */ -ASSIMP_API void aiReleasePropertyStore(C_STRUCT aiPropertyStore* p); +ASSIMP_API void aiReleasePropertyStore(C_STRUCT aiPropertyStore *p); // -------------------------------------------------------------------------------- /** Set an integer property. @@ -403,9 +400,9 @@ ASSIMP_API void aiReleasePropertyStore(C_STRUCT aiPropertyStore* p); * @param value New value for the property */ ASSIMP_API void aiSetImportPropertyInteger( - C_STRUCT aiPropertyStore* store, - const char* szName, - int value); + C_STRUCT aiPropertyStore *store, + const char *szName, + int value); // -------------------------------------------------------------------------------- /** Set a floating-point property. @@ -420,9 +417,9 @@ ASSIMP_API void aiSetImportPropertyInteger( * @param value New value for the property */ ASSIMP_API void aiSetImportPropertyFloat( - C_STRUCT aiPropertyStore* store, - const char* szName, - ai_real value); + C_STRUCT aiPropertyStore *store, + const char *szName, + ai_real value); // -------------------------------------------------------------------------------- /** Set a string property. @@ -437,9 +434,9 @@ ASSIMP_API void aiSetImportPropertyFloat( * @param st New value for the property */ ASSIMP_API void aiSetImportPropertyString( - C_STRUCT aiPropertyStore* store, - const char* szName, - const C_STRUCT aiString* st); + C_STRUCT aiPropertyStore *store, + const char *szName, + const C_STRUCT aiString *st); // -------------------------------------------------------------------------------- /** Set a matrix property. @@ -454,9 +451,9 @@ ASSIMP_API void aiSetImportPropertyString( * @param mat New value for the property */ ASSIMP_API void aiSetImportPropertyMatrix( - C_STRUCT aiPropertyStore* store, - const char* szName, - const C_STRUCT aiMatrix4x4* mat); + C_STRUCT aiPropertyStore *store, + const char *szName, + const C_STRUCT aiMatrix4x4 *mat); // -------------------------------------------------------------------------------- /** Construct a quaternion from a 3x3 rotation matrix. @@ -465,8 +462,8 @@ ASSIMP_API void aiSetImportPropertyMatrix( * @see aiQuaternion(const aiMatrix3x3& pRotMatrix) */ ASSIMP_API void aiCreateQuaternionFromMatrix( - C_STRUCT aiQuaternion* quat, - const C_STRUCT aiMatrix3x3* mat); + C_STRUCT aiQuaternion *quat, + const C_STRUCT aiMatrix3x3 *mat); // -------------------------------------------------------------------------------- /** Decompose a transformation matrix into its rotational, translational and @@ -479,24 +476,24 @@ ASSIMP_API void aiCreateQuaternionFromMatrix( * @see aiMatrix4x4::Decompose (aiVector3D&, aiQuaternion&, aiVector3D&) const; */ ASSIMP_API void aiDecomposeMatrix( - const C_STRUCT aiMatrix4x4* mat, - C_STRUCT aiVector3D* scaling, - C_STRUCT aiQuaternion* rotation, - C_STRUCT aiVector3D* position); + const C_STRUCT aiMatrix4x4 *mat, + C_STRUCT aiVector3D *scaling, + C_STRUCT aiQuaternion *rotation, + C_STRUCT aiVector3D *position); // -------------------------------------------------------------------------------- /** Transpose a 4x4 matrix. * @param mat Pointer to the matrix to be transposed */ ASSIMP_API void aiTransposeMatrix4( - C_STRUCT aiMatrix4x4* mat); + C_STRUCT aiMatrix4x4 *mat); // -------------------------------------------------------------------------------- /** Transpose a 3x3 matrix. * @param mat Pointer to the matrix to be transposed */ ASSIMP_API void aiTransposeMatrix3( - C_STRUCT aiMatrix3x3* mat); + C_STRUCT aiMatrix3x3 *mat); // -------------------------------------------------------------------------------- /** Transform a vector by a 3x3 matrix @@ -504,8 +501,8 @@ ASSIMP_API void aiTransposeMatrix3( * @param mat Matrix to transform the vector with. */ ASSIMP_API void aiTransformVecByMatrix3( - C_STRUCT aiVector3D* vec, - const C_STRUCT aiMatrix3x3* mat); + C_STRUCT aiVector3D *vec, + const C_STRUCT aiMatrix3x3 *mat); // -------------------------------------------------------------------------------- /** Transform a vector by a 4x4 matrix @@ -513,8 +510,8 @@ ASSIMP_API void aiTransformVecByMatrix3( * @param mat Matrix to transform the vector with. */ ASSIMP_API void aiTransformVecByMatrix4( - C_STRUCT aiVector3D* vec, - const C_STRUCT aiMatrix4x4* mat); + C_STRUCT aiVector3D *vec, + const C_STRUCT aiMatrix4x4 *mat); // -------------------------------------------------------------------------------- /** Multiply two 4x4 matrices. @@ -522,8 +519,8 @@ ASSIMP_API void aiTransformVecByMatrix4( * @param src Matrix to be multiplied with 'dst'. */ ASSIMP_API void aiMultiplyMatrix4( - C_STRUCT aiMatrix4x4* dst, - const C_STRUCT aiMatrix4x4* src); + C_STRUCT aiMatrix4x4 *dst, + const C_STRUCT aiMatrix4x4 *src); // -------------------------------------------------------------------------------- /** Multiply two 3x3 matrices. @@ -531,22 +528,22 @@ ASSIMP_API void aiMultiplyMatrix4( * @param src Matrix to be multiplied with 'dst'. */ ASSIMP_API void aiMultiplyMatrix3( - C_STRUCT aiMatrix3x3* dst, - const C_STRUCT aiMatrix3x3* src); + C_STRUCT aiMatrix3x3 *dst, + const C_STRUCT aiMatrix3x3 *src); // -------------------------------------------------------------------------------- /** Get a 3x3 identity matrix. * @param mat Matrix to receive its personal identity */ ASSIMP_API void aiIdentityMatrix3( - C_STRUCT aiMatrix3x3* mat); + C_STRUCT aiMatrix3x3 *mat); // -------------------------------------------------------------------------------- /** Get a 4x4 identity matrix. * @param mat Matrix to receive its personal identity */ ASSIMP_API void aiIdentityMatrix4( - C_STRUCT aiMatrix4x4* mat); + C_STRUCT aiMatrix4x4 *mat); // -------------------------------------------------------------------------------- /** Returns the number of import file formats available in the current Assimp build. @@ -561,7 +558,7 @@ ASSIMP_API size_t aiGetImportFormatCount(void); * 0 to #aiGetImportFormatCount() * @return A description of that specific import format. NULL if pIndex is out of range. */ -ASSIMP_API const C_STRUCT aiImporterDesc* aiGetImportFormatDescription( size_t pIndex); +ASSIMP_API const C_STRUCT aiImporterDesc *aiGetImportFormatDescription(size_t pIndex); // -------------------------------------------------------------------------------- /** Check if 2D vectors are equal. @@ -571,8 +568,8 @@ ASSIMP_API const C_STRUCT aiImporterDesc* aiGetImportFormatDescription( size_t p * @return 0 if the vectors are not equal */ ASSIMP_API int aiVector2AreEqual( - const C_STRUCT aiVector2D* a, - const C_STRUCT aiVector2D* b); + const C_STRUCT aiVector2D *a, + const C_STRUCT aiVector2D *b); // -------------------------------------------------------------------------------- /** Check if 2D vectors are equal using epsilon. @@ -583,9 +580,9 @@ ASSIMP_API int aiVector2AreEqual( * @return 0 if the vectors are not equal */ ASSIMP_API int aiVector2AreEqualEpsilon( - const C_STRUCT aiVector2D* a, - const C_STRUCT aiVector2D* b, - const float epsilon); + const C_STRUCT aiVector2D *a, + const C_STRUCT aiVector2D *b, + const float epsilon); // -------------------------------------------------------------------------------- /** Add 2D vectors. @@ -593,8 +590,8 @@ ASSIMP_API int aiVector2AreEqualEpsilon( * @param src Vector to be added to 'dst'. */ ASSIMP_API void aiVector2Add( - C_STRUCT aiVector2D* dst, - const C_STRUCT aiVector2D* src); + C_STRUCT aiVector2D *dst, + const C_STRUCT aiVector2D *src); // -------------------------------------------------------------------------------- /** Subtract 2D vectors. @@ -602,8 +599,8 @@ ASSIMP_API void aiVector2Add( * @param src Vector to be subtracted from 'dst'. */ ASSIMP_API void aiVector2Subtract( - C_STRUCT aiVector2D* dst, - const C_STRUCT aiVector2D* src); + C_STRUCT aiVector2D *dst, + const C_STRUCT aiVector2D *src); // -------------------------------------------------------------------------------- /** Multiply a 2D vector by a scalar. @@ -611,8 +608,8 @@ ASSIMP_API void aiVector2Subtract( * @param s Scale factor */ ASSIMP_API void aiVector2Scale( - C_STRUCT aiVector2D* dst, - const float s); + C_STRUCT aiVector2D *dst, + const float s); // -------------------------------------------------------------------------------- /** Multiply each component of a 2D vector with @@ -621,8 +618,8 @@ ASSIMP_API void aiVector2Scale( * @param other Second vector */ ASSIMP_API void aiVector2SymMul( - C_STRUCT aiVector2D* dst, - const C_STRUCT aiVector2D* other); + C_STRUCT aiVector2D *dst, + const C_STRUCT aiVector2D *other); // -------------------------------------------------------------------------------- /** Divide a 2D vector by a scalar. @@ -630,8 +627,8 @@ ASSIMP_API void aiVector2SymMul( * @param s Scalar divisor */ ASSIMP_API void aiVector2DivideByScalar( - C_STRUCT aiVector2D* dst, - const float s); + C_STRUCT aiVector2D *dst, + const float s); // -------------------------------------------------------------------------------- /** Divide each component of a 2D vector by @@ -640,29 +637,29 @@ ASSIMP_API void aiVector2DivideByScalar( * @param v Vector as the divisor */ ASSIMP_API void aiVector2DivideByVector( - C_STRUCT aiVector2D* dst, - C_STRUCT aiVector2D* v); + C_STRUCT aiVector2D *dst, + C_STRUCT aiVector2D *v); // -------------------------------------------------------------------------------- /** Get the length of a 2D vector. * @return v Vector to evaluate */ ASSIMP_API float aiVector2Length( - const C_STRUCT aiVector2D* v); + const C_STRUCT aiVector2D *v); // -------------------------------------------------------------------------------- /** Get the squared length of a 2D vector. * @return v Vector to evaluate */ ASSIMP_API float aiVector2SquareLength( - const C_STRUCT aiVector2D* v); + const C_STRUCT aiVector2D *v); // -------------------------------------------------------------------------------- /** Negate a 2D vector. * @param dst Vector to be negated */ ASSIMP_API void aiVector2Negate( - C_STRUCT aiVector2D* dst); + C_STRUCT aiVector2D *dst); // -------------------------------------------------------------------------------- /** Get the dot product of 2D vectors. @@ -671,15 +668,15 @@ ASSIMP_API void aiVector2Negate( * @return The dot product of vectors */ ASSIMP_API float aiVector2DotProduct( - const C_STRUCT aiVector2D* a, - const C_STRUCT aiVector2D* b); + const C_STRUCT aiVector2D *a, + const C_STRUCT aiVector2D *b); // -------------------------------------------------------------------------------- /** Normalize a 2D vector. * @param v Vector to normalize */ ASSIMP_API void aiVector2Normalize( - C_STRUCT aiVector2D* v); + C_STRUCT aiVector2D *v); // -------------------------------------------------------------------------------- /** Check if 3D vectors are equal. @@ -689,8 +686,8 @@ ASSIMP_API void aiVector2Normalize( * @return 0 if the vectors are not equal */ ASSIMP_API int aiVector3AreEqual( - const C_STRUCT aiVector3D* a, - const C_STRUCT aiVector3D* b); + const C_STRUCT aiVector3D *a, + const C_STRUCT aiVector3D *b); // -------------------------------------------------------------------------------- /** Check if 3D vectors are equal using epsilon. @@ -701,9 +698,9 @@ ASSIMP_API int aiVector3AreEqual( * @return 0 if the vectors are not equal */ ASSIMP_API int aiVector3AreEqualEpsilon( - const C_STRUCT aiVector3D* a, - const C_STRUCT aiVector3D* b, - const float epsilon); + const C_STRUCT aiVector3D *a, + const C_STRUCT aiVector3D *b, + const float epsilon); // -------------------------------------------------------------------------------- /** Check if vector \p a is less than vector \p b. @@ -714,8 +711,8 @@ ASSIMP_API int aiVector3AreEqualEpsilon( * @return 0 if \p a is equal or greater than \p b */ ASSIMP_API int aiVector3LessThan( - const C_STRUCT aiVector3D* a, - const C_STRUCT aiVector3D* b); + const C_STRUCT aiVector3D *a, + const C_STRUCT aiVector3D *b); // -------------------------------------------------------------------------------- /** Add 3D vectors. @@ -723,8 +720,8 @@ ASSIMP_API int aiVector3LessThan( * @param src Vector to be added to 'dst'. */ ASSIMP_API void aiVector3Add( - C_STRUCT aiVector3D* dst, - const C_STRUCT aiVector3D* src); + C_STRUCT aiVector3D *dst, + const C_STRUCT aiVector3D *src); // -------------------------------------------------------------------------------- /** Subtract 3D vectors. @@ -732,8 +729,8 @@ ASSIMP_API void aiVector3Add( * @param src Vector to be subtracted from 'dst'. */ ASSIMP_API void aiVector3Subtract( - C_STRUCT aiVector3D* dst, - const C_STRUCT aiVector3D* src); + C_STRUCT aiVector3D *dst, + const C_STRUCT aiVector3D *src); // -------------------------------------------------------------------------------- /** Multiply a 3D vector by a scalar. @@ -741,8 +738,8 @@ ASSIMP_API void aiVector3Subtract( * @param s Scale factor */ ASSIMP_API void aiVector3Scale( - C_STRUCT aiVector3D* dst, - const float s); + C_STRUCT aiVector3D *dst, + const float s); // -------------------------------------------------------------------------------- /** Multiply each component of a 3D vector with @@ -751,8 +748,8 @@ ASSIMP_API void aiVector3Scale( * @param other Second vector */ ASSIMP_API void aiVector3SymMul( - C_STRUCT aiVector3D* dst, - const C_STRUCT aiVector3D* other); + C_STRUCT aiVector3D *dst, + const C_STRUCT aiVector3D *other); // -------------------------------------------------------------------------------- /** Divide a 3D vector by a scalar. @@ -760,8 +757,8 @@ ASSIMP_API void aiVector3SymMul( * @param s Scalar divisor */ ASSIMP_API void aiVector3DivideByScalar( - C_STRUCT aiVector3D* dst, - const float s); + C_STRUCT aiVector3D *dst, + const float s); // -------------------------------------------------------------------------------- /** Divide each component of a 3D vector by @@ -770,29 +767,29 @@ ASSIMP_API void aiVector3DivideByScalar( * @param v Vector as the divisor */ ASSIMP_API void aiVector3DivideByVector( - C_STRUCT aiVector3D* dst, - C_STRUCT aiVector3D* v); + C_STRUCT aiVector3D *dst, + C_STRUCT aiVector3D *v); // -------------------------------------------------------------------------------- /** Get the length of a 3D vector. * @return v Vector to evaluate */ ASSIMP_API float aiVector3Length( - const C_STRUCT aiVector3D* v); + const C_STRUCT aiVector3D *v); // -------------------------------------------------------------------------------- /** Get the squared length of a 3D vector. * @return v Vector to evaluate */ ASSIMP_API float aiVector3SquareLength( - const C_STRUCT aiVector3D* v); + const C_STRUCT aiVector3D *v); // -------------------------------------------------------------------------------- /** Negate a 3D vector. * @param dst Vector to be negated */ ASSIMP_API void aiVector3Negate( - C_STRUCT aiVector3D* dst); + C_STRUCT aiVector3D *dst); // -------------------------------------------------------------------------------- /** Get the dot product of 3D vectors. @@ -801,8 +798,8 @@ ASSIMP_API void aiVector3Negate( * @return The dot product of vectors */ ASSIMP_API float aiVector3DotProduct( - const C_STRUCT aiVector3D* a, - const C_STRUCT aiVector3D* b); + const C_STRUCT aiVector3D *a, + const C_STRUCT aiVector3D *b); // -------------------------------------------------------------------------------- /** Get cross product of 3D vectors. @@ -812,23 +809,23 @@ ASSIMP_API float aiVector3DotProduct( * @return The dot product of vectors */ ASSIMP_API void aiVector3CrossProduct( - C_STRUCT aiVector3D* dst, - const C_STRUCT aiVector3D* a, - const C_STRUCT aiVector3D* b); + C_STRUCT aiVector3D *dst, + const C_STRUCT aiVector3D *a, + const C_STRUCT aiVector3D *b); // -------------------------------------------------------------------------------- /** Normalize a 3D vector. * @param v Vector to normalize */ ASSIMP_API void aiVector3Normalize( - C_STRUCT aiVector3D* v); + C_STRUCT aiVector3D *v); // -------------------------------------------------------------------------------- /** Check for division by zero and normalize a 3D vector. * @param v Vector to normalize */ ASSIMP_API void aiVector3NormalizeSafe( - C_STRUCT aiVector3D* v); + C_STRUCT aiVector3D *v); // -------------------------------------------------------------------------------- /** Rotate a 3D vector by a quaternion. @@ -836,8 +833,8 @@ ASSIMP_API void aiVector3NormalizeSafe( * @param q Quaternion to use to rotate \p v */ ASSIMP_API void aiVector3RotateByQuaternion( - C_STRUCT aiVector3D* v, - const C_STRUCT aiQuaternion* q); + C_STRUCT aiVector3D *v, + const C_STRUCT aiQuaternion *q); // -------------------------------------------------------------------------------- /** Construct a 3x3 matrix from a 4x4 matrix. @@ -845,8 +842,8 @@ ASSIMP_API void aiVector3RotateByQuaternion( * @param mat The 4x4 matrix to use */ ASSIMP_API void aiMatrix3FromMatrix4( - C_STRUCT aiMatrix3x3* dst, - const C_STRUCT aiMatrix4x4* mat); + C_STRUCT aiMatrix3x3 *dst, + const C_STRUCT aiMatrix4x4 *mat); // -------------------------------------------------------------------------------- /** Construct a 3x3 matrix from a quaternion. @@ -854,8 +851,8 @@ ASSIMP_API void aiMatrix3FromMatrix4( * @param q The quaternion matrix to use */ ASSIMP_API void aiMatrix3FromQuaternion( - C_STRUCT aiMatrix3x3* mat, - const C_STRUCT aiQuaternion* q); + C_STRUCT aiMatrix3x3 *mat, + const C_STRUCT aiQuaternion *q); // -------------------------------------------------------------------------------- /** Check if 3x3 matrices are equal. @@ -865,8 +862,8 @@ ASSIMP_API void aiMatrix3FromQuaternion( * @return 0 if the matrices are not equal */ ASSIMP_API int aiMatrix3AreEqual( - const C_STRUCT aiMatrix3x3* a, - const C_STRUCT aiMatrix3x3* b); + const C_STRUCT aiMatrix3x3 *a, + const C_STRUCT aiMatrix3x3 *b); // -------------------------------------------------------------------------------- /** Check if 3x3 matrices are equal. @@ -877,23 +874,23 @@ ASSIMP_API int aiMatrix3AreEqual( * @return 0 if the matrices are not equal */ ASSIMP_API int aiMatrix3AreEqualEpsilon( - const C_STRUCT aiMatrix3x3* a, - const C_STRUCT aiMatrix3x3* b, - const float epsilon); + const C_STRUCT aiMatrix3x3 *a, + const C_STRUCT aiMatrix3x3 *b, + const float epsilon); // -------------------------------------------------------------------------------- /** Invert a 3x3 matrix. * @param mat Matrix to invert */ ASSIMP_API void aiMatrix3Inverse( - C_STRUCT aiMatrix3x3* mat); + C_STRUCT aiMatrix3x3 *mat); // -------------------------------------------------------------------------------- /** Get the determinant of a 3x3 matrix. * @param mat Matrix to get the determinant from */ ASSIMP_API float aiMatrix3Determinant( - const C_STRUCT aiMatrix3x3* mat); + const C_STRUCT aiMatrix3x3 *mat); // -------------------------------------------------------------------------------- /** Get a 3x3 rotation matrix around the Z axis. @@ -901,8 +898,8 @@ ASSIMP_API float aiMatrix3Determinant( * @param angle Rotation angle, in radians */ ASSIMP_API void aiMatrix3RotationZ( - C_STRUCT aiMatrix3x3* mat, - const float angle); + C_STRUCT aiMatrix3x3 *mat, + const float angle); // -------------------------------------------------------------------------------- /** Returns a 3x3 rotation matrix for a rotation around an arbitrary axis. @@ -911,9 +908,9 @@ ASSIMP_API void aiMatrix3RotationZ( * @param angle Rotation angle, in radians */ ASSIMP_API void aiMatrix3FromRotationAroundAxis( - C_STRUCT aiMatrix3x3* mat, - const C_STRUCT aiVector3D* axis, - const float angle); + C_STRUCT aiMatrix3x3 *mat, + const C_STRUCT aiVector3D *axis, + const float angle); // -------------------------------------------------------------------------------- /** Get a 3x3 translation matrix. @@ -921,8 +918,8 @@ ASSIMP_API void aiMatrix3FromRotationAroundAxis( * @param translation The translation vector */ ASSIMP_API void aiMatrix3Translation( - C_STRUCT aiMatrix3x3* mat, - const C_STRUCT aiVector2D* translation); + C_STRUCT aiMatrix3x3 *mat, + const C_STRUCT aiVector2D *translation); // -------------------------------------------------------------------------------- /** Create a 3x3 matrix that rotates one vector to another vector. @@ -931,9 +928,9 @@ ASSIMP_API void aiMatrix3Translation( * @param to Vector to rotate to */ ASSIMP_API void aiMatrix3FromTo( - C_STRUCT aiMatrix3x3* mat, - const C_STRUCT aiVector3D* from, - const C_STRUCT aiVector3D* to); + C_STRUCT aiMatrix3x3 *mat, + const C_STRUCT aiVector3D *from, + const C_STRUCT aiVector3D *to); // -------------------------------------------------------------------------------- /** Construct a 4x4 matrix from a 3x3 matrix. @@ -941,8 +938,8 @@ ASSIMP_API void aiMatrix3FromTo( * @param mat The 3x3 matrix to use */ ASSIMP_API void aiMatrix4FromMatrix3( - C_STRUCT aiMatrix4x4* dst, - const C_STRUCT aiMatrix3x3* mat); + C_STRUCT aiMatrix4x4 *dst, + const C_STRUCT aiMatrix3x3 *mat); // -------------------------------------------------------------------------------- /** Construct a 4x4 matrix from scaling, rotation and position. @@ -952,10 +949,10 @@ ASSIMP_API void aiMatrix4FromMatrix3( * @param position The position for the x,y,z axes */ ASSIMP_API void aiMatrix4FromScalingQuaternionPosition( - C_STRUCT aiMatrix4x4* mat, - const C_STRUCT aiVector3D* scaling, - const C_STRUCT aiQuaternion* rotation, - const C_STRUCT aiVector3D* position); + C_STRUCT aiMatrix4x4 *mat, + const C_STRUCT aiVector3D *scaling, + const C_STRUCT aiQuaternion *rotation, + const C_STRUCT aiVector3D *position); // -------------------------------------------------------------------------------- /** Add 4x4 matrices. @@ -963,8 +960,8 @@ ASSIMP_API void aiMatrix4FromScalingQuaternionPosition( * @param src Matrix to be added to 'dst'. */ ASSIMP_API void aiMatrix4Add( - C_STRUCT aiMatrix4x4* dst, - const C_STRUCT aiMatrix4x4* src); + C_STRUCT aiMatrix4x4 *dst, + const C_STRUCT aiMatrix4x4 *src); // -------------------------------------------------------------------------------- /** Check if 4x4 matrices are equal. @@ -974,8 +971,8 @@ ASSIMP_API void aiMatrix4Add( * @return 0 if the matrices are not equal */ ASSIMP_API int aiMatrix4AreEqual( - const C_STRUCT aiMatrix4x4* a, - const C_STRUCT aiMatrix4x4* b); + const C_STRUCT aiMatrix4x4 *a, + const C_STRUCT aiMatrix4x4 *b); // -------------------------------------------------------------------------------- /** Check if 4x4 matrices are equal. @@ -986,16 +983,16 @@ ASSIMP_API int aiMatrix4AreEqual( * @return 0 if the matrices are not equal */ ASSIMP_API int aiMatrix4AreEqualEpsilon( - const C_STRUCT aiMatrix4x4* a, - const C_STRUCT aiMatrix4x4* b, - const float epsilon); + const C_STRUCT aiMatrix4x4 *a, + const C_STRUCT aiMatrix4x4 *b, + const float epsilon); // -------------------------------------------------------------------------------- /** Invert a 4x4 matrix. * @param result Matrix to invert */ ASSIMP_API void aiMatrix4Inverse( - C_STRUCT aiMatrix4x4* mat); + C_STRUCT aiMatrix4x4 *mat); // -------------------------------------------------------------------------------- /** Get the determinant of a 4x4 matrix. @@ -1003,7 +1000,7 @@ ASSIMP_API void aiMatrix4Inverse( * @return The determinant of the matrix */ ASSIMP_API float aiMatrix4Determinant( - const C_STRUCT aiMatrix4x4* mat); + const C_STRUCT aiMatrix4x4 *mat); // -------------------------------------------------------------------------------- /** Returns true of the matrix is the identity matrix. @@ -1012,7 +1009,7 @@ ASSIMP_API float aiMatrix4Determinant( * @return 0 if \p mat is not an identity matrix. */ ASSIMP_API int aiMatrix4IsIdentity( - const C_STRUCT aiMatrix4x4* mat); + const C_STRUCT aiMatrix4x4 *mat); // -------------------------------------------------------------------------------- /** Decompose a transformation matrix into its scaling, @@ -1024,10 +1021,10 @@ ASSIMP_API int aiMatrix4IsIdentity( * @param position Receives the output position for the x,y,z axes */ ASSIMP_API void aiMatrix4DecomposeIntoScalingEulerAnglesPosition( - const C_STRUCT aiMatrix4x4* mat, - C_STRUCT aiVector3D* scaling, - C_STRUCT aiVector3D* rotation, - C_STRUCT aiVector3D* position); + const C_STRUCT aiMatrix4x4 *mat, + C_STRUCT aiVector3D *scaling, + C_STRUCT aiVector3D *rotation, + C_STRUCT aiVector3D *position); // -------------------------------------------------------------------------------- /** Decompose a transformation matrix into its scaling, @@ -1041,11 +1038,11 @@ ASSIMP_API void aiMatrix4DecomposeIntoScalingEulerAnglesPosition( * @param position Receives the output position for the x,y,z axes. */ ASSIMP_API void aiMatrix4DecomposeIntoScalingAxisAnglePosition( - const C_STRUCT aiMatrix4x4* mat, - C_STRUCT aiVector3D* scaling, - C_STRUCT aiVector3D* axis, - ai_real* angle, - C_STRUCT aiVector3D* position); + const C_STRUCT aiMatrix4x4 *mat, + C_STRUCT aiVector3D *scaling, + C_STRUCT aiVector3D *axis, + ai_real *angle, + C_STRUCT aiVector3D *position); // -------------------------------------------------------------------------------- /** Decompose a transformation matrix into its rotational and @@ -1056,9 +1053,9 @@ ASSIMP_API void aiMatrix4DecomposeIntoScalingAxisAnglePosition( * @param position Receives the translational component. */ ASSIMP_API void aiMatrix4DecomposeNoScaling( - const C_STRUCT aiMatrix4x4* mat, - C_STRUCT aiQuaternion* rotation, - C_STRUCT aiVector3D* position); + const C_STRUCT aiMatrix4x4 *mat, + C_STRUCT aiQuaternion *rotation, + C_STRUCT aiVector3D *position); // -------------------------------------------------------------------------------- /** Creates a 4x4 matrix from a set of euler angles. @@ -1068,8 +1065,8 @@ ASSIMP_API void aiMatrix4DecomposeNoScaling( * @param z Rotation angle for the z-axis, in radians */ ASSIMP_API void aiMatrix4FromEulerAngles( - C_STRUCT aiMatrix4x4* mat, - float x, float y, float z); + C_STRUCT aiMatrix4x4 *mat, + float x, float y, float z); // -------------------------------------------------------------------------------- /** Get a 4x4 rotation matrix around the X axis. @@ -1077,8 +1074,8 @@ ASSIMP_API void aiMatrix4FromEulerAngles( * @param angle Rotation angle, in radians */ ASSIMP_API void aiMatrix4RotationX( - C_STRUCT aiMatrix4x4* mat, - const float angle); + C_STRUCT aiMatrix4x4 *mat, + const float angle); // -------------------------------------------------------------------------------- /** Get a 4x4 rotation matrix around the Y axis. @@ -1086,8 +1083,8 @@ ASSIMP_API void aiMatrix4RotationX( * @param angle Rotation angle, in radians */ ASSIMP_API void aiMatrix4RotationY( - C_STRUCT aiMatrix4x4* mat, - const float angle); + C_STRUCT aiMatrix4x4 *mat, + const float angle); // -------------------------------------------------------------------------------- /** Get a 4x4 rotation matrix around the Z axis. @@ -1095,8 +1092,8 @@ ASSIMP_API void aiMatrix4RotationY( * @param angle Rotation angle, in radians */ ASSIMP_API void aiMatrix4RotationZ( - C_STRUCT aiMatrix4x4* mat, - const float angle); + C_STRUCT aiMatrix4x4 *mat, + const float angle); // -------------------------------------------------------------------------------- /** Returns a 4x4 rotation matrix for a rotation around an arbitrary axis. @@ -1105,9 +1102,9 @@ ASSIMP_API void aiMatrix4RotationZ( * @param angle Rotation angle, in radians */ ASSIMP_API void aiMatrix4FromRotationAroundAxis( - C_STRUCT aiMatrix4x4* mat, - const C_STRUCT aiVector3D* axis, - const float angle); + C_STRUCT aiMatrix4x4 *mat, + const C_STRUCT aiVector3D *axis, + const float angle); // -------------------------------------------------------------------------------- /** Get a 4x4 translation matrix. @@ -1115,8 +1112,8 @@ ASSIMP_API void aiMatrix4FromRotationAroundAxis( * @param translation The translation vector */ ASSIMP_API void aiMatrix4Translation( - C_STRUCT aiMatrix4x4* mat, - const C_STRUCT aiVector3D* translation); + C_STRUCT aiMatrix4x4 *mat, + const C_STRUCT aiVector3D *translation); // -------------------------------------------------------------------------------- /** Get a 4x4 scaling matrix. @@ -1124,8 +1121,8 @@ ASSIMP_API void aiMatrix4Translation( * @param scaling The scaling vector */ ASSIMP_API void aiMatrix4Scaling( - C_STRUCT aiMatrix4x4* mat, - const C_STRUCT aiVector3D* scaling); + C_STRUCT aiMatrix4x4 *mat, + const C_STRUCT aiVector3D *scaling); // -------------------------------------------------------------------------------- /** Create a 4x4 matrix that rotates one vector to another vector. @@ -1134,9 +1131,9 @@ ASSIMP_API void aiMatrix4Scaling( * @param to Vector to rotate to */ ASSIMP_API void aiMatrix4FromTo( - C_STRUCT aiMatrix4x4* mat, - const C_STRUCT aiVector3D* from, - const C_STRUCT aiVector3D* to); + C_STRUCT aiMatrix4x4 *mat, + const C_STRUCT aiVector3D *from, + const C_STRUCT aiVector3D *to); // -------------------------------------------------------------------------------- /** Create a Quaternion from euler angles. @@ -1146,8 +1143,8 @@ ASSIMP_API void aiMatrix4FromTo( * @param z Rotation angle for the z-axis, in radians */ ASSIMP_API void aiQuaternionFromEulerAngles( - C_STRUCT aiQuaternion* q, - float x, float y, float z); + C_STRUCT aiQuaternion *q, + float x, float y, float z); // -------------------------------------------------------------------------------- /** Create a Quaternion from an axis angle pair. @@ -1156,9 +1153,9 @@ ASSIMP_API void aiQuaternionFromEulerAngles( * @param angle The rotation angle, in radians */ ASSIMP_API void aiQuaternionFromAxisAngle( - C_STRUCT aiQuaternion* q, - const C_STRUCT aiVector3D* axis, - const float angle); + C_STRUCT aiQuaternion *q, + const C_STRUCT aiVector3D *axis, + const float angle); // -------------------------------------------------------------------------------- /** Create a Quaternion from a normalized quaternion stored @@ -1167,8 +1164,8 @@ ASSIMP_API void aiQuaternionFromAxisAngle( * @param normalized The vector that stores the quaternion */ ASSIMP_API void aiQuaternionFromNormalizedQuaternion( - C_STRUCT aiQuaternion* q, - const C_STRUCT aiVector3D* normalized); + C_STRUCT aiQuaternion *q, + const C_STRUCT aiVector3D *normalized); // -------------------------------------------------------------------------------- /** Check if quaternions are equal. @@ -1178,8 +1175,8 @@ ASSIMP_API void aiQuaternionFromNormalizedQuaternion( * @return 0 if the quaternions are not equal */ ASSIMP_API int aiQuaternionAreEqual( - const C_STRUCT aiQuaternion* a, - const C_STRUCT aiQuaternion* b); + const C_STRUCT aiQuaternion *a, + const C_STRUCT aiQuaternion *b); // -------------------------------------------------------------------------------- /** Check if quaternions are equal using epsilon. @@ -1190,16 +1187,16 @@ ASSIMP_API int aiQuaternionAreEqual( * @return 0 if the quaternions are not equal */ ASSIMP_API int aiQuaternionAreEqualEpsilon( - const C_STRUCT aiQuaternion* a, - const C_STRUCT aiQuaternion* b, - const float epsilon); + const C_STRUCT aiQuaternion *a, + const C_STRUCT aiQuaternion *b, + const float epsilon); // -------------------------------------------------------------------------------- /** Normalize a quaternion. * @param q Quaternion to normalize */ ASSIMP_API void aiQuaternionNormalize( - C_STRUCT aiQuaternion* q); + C_STRUCT aiQuaternion *q); // -------------------------------------------------------------------------------- /** Compute quaternion conjugate. @@ -1207,7 +1204,7 @@ ASSIMP_API void aiQuaternionNormalize( * receives the output quaternion */ ASSIMP_API void aiQuaternionConjugate( - C_STRUCT aiQuaternion* q); + C_STRUCT aiQuaternion *q); // -------------------------------------------------------------------------------- /** Multiply quaternions. @@ -1215,8 +1212,8 @@ ASSIMP_API void aiQuaternionConjugate( * @param q Second quaternion */ ASSIMP_API void aiQuaternionMultiply( - C_STRUCT aiQuaternion* dst, - const C_STRUCT aiQuaternion* q); + C_STRUCT aiQuaternion *dst, + const C_STRUCT aiQuaternion *q); // -------------------------------------------------------------------------------- /** Performs a spherical interpolation between two quaternions. @@ -1226,10 +1223,10 @@ ASSIMP_API void aiQuaternionMultiply( * @param factor Interpolation factor between 0 and 1 */ ASSIMP_API void aiQuaternionInterpolate( - C_STRUCT aiQuaternion* dst, - const C_STRUCT aiQuaternion* start, - const C_STRUCT aiQuaternion* end, - const float factor); + C_STRUCT aiQuaternion *dst, + const C_STRUCT aiQuaternion *start, + const C_STRUCT aiQuaternion *end, + const float factor); #ifdef __cplusplus } diff --git a/include/assimp/importerdesc.h b/include/assimp/importerdesc.h index f731ed1c4..a2817d929 100644 --- a/include/assimp/importerdesc.h +++ b/include/assimp/importerdesc.h @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2020, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -49,9 +47,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_IMPORTER_DESC_H_INC #ifdef __GNUC__ -#pragma GCC system_header +# pragma GCC system_header #endif +#include + /** Mixed set of flags for #aiImporterDesc, indicating some features * common to many importers*/ enum aiImporterFlags { diff --git a/test/unit/AssimpAPITest.cpp b/test/unit/AssimpAPITest.cpp index c30f6f384..32df1a0a9 100644 --- a/test/unit/AssimpAPITest.cpp +++ b/test/unit/AssimpAPITest.cpp @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2020, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -46,14 +44,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using namespace Assimp; class AssimpAPITest : public ::testing::Test { - + // empty }; TEST_F( AssimpAPITest, aiGetImporterDescTest ) { - const aiImporterDesc *desc( NULL ); - desc = aiGetImporterDesc( NULL ); - EXPECT_EQ( NULL, desc ); + const aiImporterDesc *desc( nullptr ); + desc = aiGetImporterDesc(nullptr); + EXPECT_EQ(nullptr, desc); desc = aiGetImporterDesc( "obj" ); - EXPECT_TRUE( NULL != desc ); + EXPECT_TRUE(nullptr != desc); +} + +TEST_F( AssimpAPITest, aiGetLastErrorTest ) { + const char *error = aiGetErrorString(); + EXPECT_NE(nullptr, error); }