Skip to content

Commit c80fbe4

Browse files
committed
do not proxy variables where the config asks for the variable's address
1 parent ed3fc82 commit c80fbe4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkgs/ffigen/lib/src/header_parser/sub_parsers/var_parser.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ Binding? parseVarDeclaration(Context context, clang_types.CXCursor cursor) {
2828
final decl = Declaration(usr: usr, originalName: name);
2929
final cType = cursor.type();
3030

31-
// Try to evaluate as a constant first.
32-
if (cType.isConstQualified) {
31+
// Try to evaluate as a constant first,
32+
// unless the config asks for the variable's address.
33+
if (cType.isConstQualified && !config.globals.includeSymbolAddress(decl)) {
3334
final evalResult = clang.clang_Cursor_Evaluate(cursor);
3435
final evalKind = clang.clang_EvalResult_getKind(evalResult);
3536
Constant? constant;

0 commit comments

Comments
 (0)