diff --git a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/StubGenerator.kt b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/StubGenerator.kt index 7dff517ebf4..f42761ad1c5 100644 --- a/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/StubGenerator.kt +++ b/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/StubGenerator.kt @@ -170,7 +170,7 @@ class StubGenerator( val functionsToBind = nativeIndex.functions.filter { it.name !in excludedFunctions } - private val macroConstantsByName = nativeIndex.macroConstants.associateBy { it.name } + private val macroConstantsByName = (nativeIndex.macroConstants + nativeIndex.wrappedMacros).associateBy { it.name } val kotlinFile = object : KotlinFile(pkgName, namesToBeDeclared = computeNamesToBeDeclared()) { override val mappingBridgeGenerator: MappingBridgeGenerator diff --git a/backend.native/tests/interop/basics/cmacros.def b/backend.native/tests/interop/basics/cmacros.def index 1097d534d1d..e5a6dd9adf1 100644 --- a/backend.native/tests/interop/basics/cmacros.def +++ b/backend.native/tests/interop/basics/cmacros.def @@ -41,6 +41,10 @@ int global_var = 5; #define PTR_SUM (INT_PTR + 1) #define PTR_SUM_EXPECTED (sizeof(int) + 1) +enum { + INT_CALL = 1 // Should be replaced by macro below. +}; + #define PTR_CALL ptr_call() #define INT_CALL int_call() #define CALL_SUM (int_call() + int_call())