Skip to content

Commit 8fa8838

Browse files
committed
fbc: cva_list name mangling with arm32 and arm64 (aarch64) targets
- add missing notes to symbKeywordTypeInit() (cherry picked from commit c4ddb98)
1 parent 97d2319 commit 8fa8838

File tree

1 file changed

+38
-31
lines changed

1 file changed

+38
-31
lines changed

src/compiler/symb-keyword.bas

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -411,34 +411,41 @@ sub symbKeywordTypeInit( )
411411

412412
'' add the default cva_list type
413413
''
414-
'' #if (__FB_BACKEND__ = "gcc")
415-
'' #if defined( __FB_64BIT__ )
416-
'' #if defined( __FB_ARM__ )
417-
'' type __va_list alias "__va_list"
418-
'' as any ptr __stack
419-
'' as any ptr __gr_top
420-
'' as any ptr __vr_top
421-
'' as long __gr_offs
422-
'' as long __vr_offs
423-
'' end type
424-
'' type cva_list as __va_list alias "__builtin_va_list"
425-
'' #elseif defined( __FB_WIN32__ )
426-
'' type cva_list as any alias "__builtin_va_list" ptr
427-
'' #else
428-
'' type __va_list_tag alias "__va_list_tag"
429-
'' as ulong gp_offset
430-
'' as ulong fp_offset
431-
'' as any ptr overflow_arg_area
432-
'' as any ptr reg_save_area
433-
'' end type
434-
'' type cva_list as __va_list_tag alias "__builtin_va_list[]"
435-
'' #endif
436-
'' #else
437-
'' type cva_list as any alias "__builtin_va_list" ptr
438-
'' #endif
439-
'' #else
440-
'' type cva_list as any alias "char" ptr
441-
'' #endif
414+
'' #if (__FB_BACKEND__ = "gcc")
415+
'' #if defined( __FB_64BIT__ )
416+
'' #if defined( __FB_ARM__ )
417+
'' type __va_list alias "__va_list"
418+
'' as any ptr __stack
419+
'' as any ptr __gr_top
420+
'' as any ptr __vr_top
421+
'' as long __gr_offs
422+
'' as long __vr_offs
423+
'' end type
424+
'' type cva_list as __va_list alias "__builtin_va_list"
425+
'' #elseif defined( __FB_WIN32__ )
426+
'' type cva_list as any alias "__builtin_va_list" ptr
427+
'' #else
428+
'' type __va_list_tag alias "__va_list_tag"
429+
'' as ulong gp_offset
430+
'' as ulong fp_offset
431+
'' as any ptr overflow_arg_area
432+
'' as any ptr reg_save_area
433+
'' end type
434+
'' type cva_list as __va_list_tag alias "__builtin_va_list[]"
435+
'' #endif
436+
'' #else
437+
'' #if defined( __FB_ARM__ )
438+
'' type __va_list alias "__va_list"
439+
'' as any ptr __ap
440+
'' end type
441+
'' type cva_list as __va_list alias "__builtin_va_list"
442+
'' #else
443+
'' type cva_list as any alias "__builtin_va_list" ptr
444+
'' #endif
445+
'' #endif
446+
'' #else
447+
'' type cva_list as any alias "char" ptr
448+
'' #endif
442449

443450
static as FBARRAYDIM dTB(0)
444451

@@ -529,15 +536,15 @@ sub symbKeywordTypeInit( )
529536
symbAddTypedef( pid, typeSetMangleDt( symbGetType( s ), FB_DATATYPE_VA_LIST ), s, symbGetLen( s ) )
530537

531538
case FB_CVA_LIST_BUILTIN_ARM
532-
'' cva_list is from ARM definition:
539+
'' cva_list is from ARM definition
533540
'' typdef struct __va_list {
534-
'' void *ap;
541+
'' void *__ap;
535542
'' } va_list;
536543

537544
s = symbStructBegin( NULL, NULL, NULL, "__va_list", "__va_list", FALSE, 0, FALSE, 0, 0 )
538545

539546
'' ap as any ptr
540-
symbAddField( s, "ap", 0, dTB(), typeAddrOf( FB_DATATYPE_VOID ), NULL, 0, 0, 0 )
547+
symbAddField( s, "__ap", 0, dTB(), typeAddrOf( FB_DATATYPE_VOID ), NULL, 0, 0, 0 )
541548

542549
'' end type
543550
symbStructEnd( s )

0 commit comments

Comments
 (0)