VirtualBox

Changeset 47034 in vbox for trunk


Ignore:
Timestamp:
Jul 8, 2013 12:20:14 PM (12 years ago)
Author:
vboxsync
Message:

iprt/asmdefs.mac: Added AssertCompileSize and AssertCompileMemberOffset.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asmdefs.mac

    r46855 r47034  
    9595; Mangles the given name so it can be referenced using DECLASM() in the
    9696; C/C++ world.
    97 %ifdef RT_ARCH_X86
    98  %ifdef RT_OS_OS2
     97%ifndef ASM_FORMAT_BIN
     98 %ifdef RT_ARCH_X86
     99  %ifdef RT_OS_OS2
     100   %define NAME(name)   _ %+ NAME_OVERLOAD(name)
     101  %endif
     102  %ifdef RT_OS_WINDOWS
     103   %define NAME(name)   _ %+ NAME_OVERLOAD(name)
     104  %endif
     105 %endif
     106 %ifdef RT_OS_DARWIN
    99107  %define NAME(name)    _ %+ NAME_OVERLOAD(name)
    100108 %endif
    101  %ifdef RT_OS_WINDOWS
    102   %define NAME(name)    _ %+ NAME_OVERLOAD(name)
    103  %endif
    104 %endif
    105 %ifdef RT_OS_DARWIN
    106  %define NAME(name)     _ %+ NAME_OVERLOAD(name)
    107109%endif
    108110%ifndef NAME
     
    790792%endif
    791793
    792 %endif
     794
     795;
     796; Some simple compile time assertions.
     797;
     798; Note! Requires new kBuild to work.
     799;
     800
     801;;
     802; Structure size assertion macro.
     803%define AssertCompileSize(a_Type, a_Size) AssertCompileSizeML a_Type, a_Size
     804%macro AssertCompileSizeML 2,
     805 %ifndef KBUILD_GENERATING_MAKEFILE_DEPENDENCIES
     806  %assign AssertVar_cbActual   %1 %+ _size
     807  %assign AssertVar_cbExpected %2
     808  %if AssertVar_cbActual != AssertVar_cbExpected
     809   %error %1 is AssertVar_cbActual bytes instead of AssertVar_cbExpected
     810  %endif
     811 %endif
     812%endmacro
     813
     814;;
     815; Structure memember offset assertion macro.
     816%define AssertCompileMemberOffset(a_Type, a_Member, a_off) AssertCompileMemberOffsetML a_Type, a_Member, a_off
     817%macro AssertCompileMemberOffsetML 3,
     818 %ifndef KBUILD_GENERATING_MAKEFILE_DEPENDENCIES
     819  %assign AssertVar_offActual   %1 %+ . %+ %2
     820  %assign AssertVar_offExpected %3
     821  %if AssertVar_offActual != AssertVar_offExpected
     822   %error %1 %+ . %+ %2 is at AssertVar_offActual instead of AssertVar_offExpected
     823  %endif
     824 %endif
     825%endmacro
     826
     827%endif
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette