Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #4262 Build With M3D Import Only #4879

Merged
merged 2 commits into from Jan 17, 2023

Conversation

krishty
Copy link
Contributor

@krishty krishty commented Jan 16, 2023

M3DWrapper.h is designed to omit the definition of class M3DWrapper if neither M3D import nor M3D export are compiled. 608bccd touched the corresponding preprocessor checks and introduced a bug:

#ifndef ASSIMP_BUILD_NO_M3D_IMPORTER
#if !(ASSIMP_BUILD_NO_EXPORT || ASSIMP_BUILD_NO_M3D_EXPORTER)
class M3DWrapper {

When compiling

  • with M3D import enabled,
  • but with either export generally disabled or M3D export disabled specifically, These checks evaluate to the wrong result and skip the definition, leading to a build failure in dependent code.
#if 1 // import enabled
#if !(1 || 1) // export disabled and M3D export disabled

This commit fixes the check to compile the definition if neither import is disabled.

`M3DWrapper.h` is designed to omit the definition of `class M3DWrapper` if neither M3D import nor M3D export are compiled.
608bccd touched the corresponding preprocessor checks and introduced a bug:
```
#ifndef ASSIMP_BUILD_NO_M3D_IMPORTER
#if !(ASSIMP_BUILD_NO_EXPORT || ASSIMP_BUILD_NO_M3D_EXPORTER)
class M3DWrapper {
```
When compiling
- with M3D import enabled,
- but with either export generally disabled or M3D export disabled specifically,
These checks evaluate to the wrong result and skip the definition, leading to a build failure in dependent code.
```
#if 1 // import enabled
#if !(1 || 1) // export disabled and M3D export disabled
```
This commit fixes the check to compile the definition if neither import is disabled.
@krishty krishty changed the title Fix Build With M3D Import Only Fix #4262 Build With M3D Import Only Jan 16, 2023
@krishty krishty changed the title Fix #4262 Build With M3D Import Only Fix 4262 Build With M3D Import Only Jan 16, 2023
@krishty krishty changed the title Fix 4262 Build With M3D Import Only Fix #4262 Build With M3D Import Only Jan 16, 2023
Copy link
Member

@kimkulling kimkulling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, thanks for the fix.

@kimkulling kimkulling merged commit d640a89 into assimp:master Jan 17, 2023
@kimkulling
Copy link
Member

Merged, thanks a lot for your contribution.

@krishty krishty deleted the fix-build-with-m3d-import-only branch January 17, 2023 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants