Skip to content

[RNE Rewrite] fix(build): remove redundant flag to fix macro redefinition warning - #1338

Merged
barhanc merged 1 commit into
rne-rewritefrom
@bh/fix-c10-macro-warning
Jul 30, 2026
Merged

[RNE Rewrite] fix(build): remove redundant flag to fix macro redefinition warning#1338
barhanc merged 1 commit into
rne-rewritefrom
@bh/fix-c10-macro-warning

Conversation

@barhanc

@barhanc barhanc commented Jul 30, 2026

Copy link
Copy Markdown
Member

Description

Fixes a -Wmacro-redefined compiler warning emitted when building native C++ sources. Build configurations (podspec, CMakeLists.txt, and compile_flags.txt) were explicitly setting the compiler definition -DC10_USING_CUSTOM_GENERATED_MACROS=1. However, the vendored header Macros.h (third-party/include/torch/headeronly/macros/Macros.h) already defines #define C10_USING_CUSTOM_GENERATED_MACROS directly on line 1. Passing the preprocessor macro via compiler flags resulted in macro redefinition warning.

Introduces a breaking change?

  • Yes
  • No

Type of change

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Documentation update (improves or adds clarity to existing documentation)
  • Other (chores, tests, code style improvements etc.)

Tested on

  • iOS
  • Android

Testing instructions

  • Build example apps and verify that no macro redefinition warning is emitted.

Screenshots

Related issues

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings

Additional notes

@barhanc barhanc self-assigned this Jul 30, 2026
@barhanc barhanc added the bug fix PRs that are fixing bugs label Jul 30, 2026
@barhanc barhanc changed the title [RNE Rewrite] fix(cpp): remove redundant flag to fix macro redefinition warning [RNE Rewrite] fix(build): remove redundant flag to fix macro redefinition warning Jul 30, 2026
@barhanc
barhanc merged commit 8804d56 into rne-rewrite Jul 30, 2026
3 checks passed
@barhanc
barhanc deleted the @bh/fix-c10-macro-warning branch July 30, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix PRs that are fixing bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants