VirtualBox

Changeset 96577 in vbox


Ignore:
Timestamp:
Sep 2, 2022 11:47:43 AM (2 years ago)
Author:
vboxsync
Message:

iprt/bldprog-strtab-template.cpp.h: Sparc build fix. bugref:9726

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/bldprog-strtab-template.cpp.h

    r96551 r96577  
    8585
    8686#ifdef BLDPROG_STRTAB_WITH_COMPRESSION
    87 # include <iprt/asm.h>
    8887# include <map>
    8988# include <iprt/sanitized/string>
     
    186185
    187186
     187#ifdef BLDPROG_STRTAB_WITH_COMPRESSION
     188
     189/**
     190 * Same as ASMBitTest.
     191 *
     192 * We cannot safely use ASMBitTest here because it must be inline, as this code
     193 * is used to build RuntimeBldProg. */
     194DECLINLINE(bool) BldProgBitIsSet(uint64_t const *pbmBitmap, size_t iBit)
     195{
     196    return RT_BOOL(pbmBitmap[iBit / 64] & RT_BIT_64(iBit % 64));
     197}
     198
     199
     200/**
     201 * Same as ASMBitSet.
     202 *
     203 * We cannot safely use ASMBitSet here because it must be inline, as this code
     204 * is used to build RuntimeBldProg.
     205 */
     206DECLINLINE(void) BldProgBitSet(uint64_t *pbmBitmap, size_t iBit)
     207{
     208    pbmBitmap[iBit / 64] |= RT_BIT_64(iBit % 64);
     209}
     210
     211#endif
     212
     213
    188214/**
    189215 * Initializes the strint table compiler.
     
    211237    pThis->cMaxPendingStrings = cMaxStrings;
    212238    memset(pThis->bmUsedChars, 0, sizeof(pThis->bmUsedChars));
    213     ASMBitSet(pThis->bmUsedChars, 0);    /* Some parts of the code still thinks zero is a terminator, so don't use it for now. */
     239    BldProgBitSet(pThis->bmUsedChars, 0);    /* Some parts of the code still thinks zero is a terminator, so don't use it for now. */
    214240# ifndef BLDPROG_STRTAB_PURE_ASCII
    215     ASMBitSet(pThis->bmUsedChars, 0xff); /* Reserve escape byte for codepoints above 127. */
     241    BldProgBitSet(pThis->bmUsedChars, 0xff); /* Reserve escape byte for codepoints above 127. */
    216242# endif
    217243#endif
     
    321347    char ch;
    322348    while ((ch = *psz++) != '\0')
    323         ASMBitSet(pThis->bmUsedChars, (uint8_t)ch);
     349        BldProgBitSet(pThis->bmUsedChars, (uint8_t)ch);
    324350
    325351    /*
     
    797823        char        szTmp[2] = { (char)i, '\0' };
    798824        const char *psz      = szTmp;
    799         if (   ASMBitTest(pThis->bmUsedChars, (int32_t)i)
     825        if (   BldProgBitIsSet(pThis->bmUsedChars, i)
    800826            || iDict >= SortedDict.m_cEntries)
    801827        {
     
    11651191    for (unsigned i = 0; i < RT_ELEMENTS(pThis->aCompDict); i++)
    11661192    {
    1167         if (ASMBitTest(pThis->bmUsedChars, (int32_t)i)
     1193        if (BldProgBitIsSet(pThis->bmUsedChars, i)
    11681194            ? pThis->aCompDict[i].cchString != 1 : pThis->aCompDict[i].cchString < 1)
    11691195            abort();
     
    11871213#ifdef BLDPROG_STRTAB_WITH_COMPRESSION
    11881214    for (unsigned i = 0; i < 0x100; i++)
    1189         if (!ASMBitTest(pThis->bmUsedChars, (int32_t)i)) /* Encode table references using '\xYY'. */
     1215        if (!BldProgBitIsSet(pThis->bmUsedChars, i)) /* Encode table references using '\xYY'. */
    11901216            abCharCat[i] = 2;
    11911217#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