VirtualBox

Changeset 99124 in vbox for trunk


Ignore:
Timestamp:
Mar 23, 2023 8:04:09 AM (22 months ago)
Author:
vboxsync
Message:

IPRT/getoptargv.cpp: Align g_abmQuoteChars more appropriately for ASMBitSet & ASMBitTest.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/getoptargv.cpp

    r98103 r99124  
    5252*   Header Files                                                                                                                 *
    5353*********************************************************************************************************************************/
     54/** @todo move to cdefs.h */
     55#ifdef __GNUC__
     56# define DECL_VAR_ALIGNED(a_Scope, a_Type, a_Name, a_Alignment) a_Scope a_Type a_Name __attribute__((__aligned__(a_Alignment)))
     57#elif defined(_MSC_VER)
     58# define DECL_VAR_ALIGNED(a_Scope, a_Type, a_Name, a_Alignment) a_Scope __declspec(align(a_Alignment)) a_Type a_Name
     59#else
     60# define DECL_VAR_ALIGNED(a_Scope, a_Type, a_Name, a_Alignment) a_Scope a_Type a_Name
     61#endif
     62
    5463/**
    5564 * Array indexed by the quoting type and 7-bit ASCII character.
     
    5766 * We include some extra stuff here that the corresponding shell would normally
    5867 * require quoting of.
    59  */
    60 static uint8_t
     68 *
     69 * @note We 16-byte align this as ASMBitSet/ASMBitTest expects aligned data, and
     70 *       with a uint8_t type the compiler/linker may use byte alignment.
     71 */
    6172#ifndef IPRT_REGENERATE_QUOTE_CHARS
    62 const
     73DECL_VAR_ALIGNED(static, uint8_t const, g_abmQuoteChars[RTGETOPTARGV_CNV_QUOTE_MASK + 1][16], 16) =
     74#else
     75DECL_VAR_ALIGNED(static, uint8_t,       g_abmQuoteChars[RTGETOPTARGV_CNV_QUOTE_MASK + 1][16], 16) =
    6376#endif
    64 g_abmQuoteChars[RTGETOPTARGV_CNV_QUOTE_MASK + 1][16] =
    6577{
    6678    { 0xfe, 0xff, 0xff, 0xff, 0x65, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 },
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