Fix minor cinterop bug with clashing macro and enum constant

This commit is contained in:
Svyatoslav Scherbina
2019-02-01 10:31:47 +03:00
committed by SvyatoslavScherbina
parent f9346f5d5c
commit 67b06b5f2a
2 changed files with 5 additions and 1 deletions
@@ -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
@@ -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())