VirtualBox

Changeset 96373 in vbox


Ignore:
Timestamp:
Aug 20, 2022 3:08:08 AM (2 years ago)
Author:
vboxsync
Message:

IPRT/nocrt: Implemented wcslen. bugref:10261

Location:
trunk/src/VBox/Runtime
Files:
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/Makefile.kmk

    r96371 r96373  
    19841984        common/string/strstr.cpp \
    19851985        common/string/strcspn.cpp \
    1986         common/string/strpbrk.cpp
     1986        common/string/strpbrk.cpp \
     1987        common/string/wcslen.asm
     1988
    19871989  RuntimeR3_SOURCES.amd64 = $(RuntimeBaseR3_SOURCES.amd64) \
    19881990        common/math/atan.asm  \
     
    20622064        common/string/strstr.cpp \
    20632065        common/string/strcspn.cpp \
    2064         common/string/strpbrk.cpp
     2066        common/string/strpbrk.cpp \
     2067        common/string/wcslen.asm
     2068
    20652069  RuntimeR3_SOURCES.win = $(filter-out \
    20662070        r3/generic/RTLocaleQueryLocaleName-r3-generic.cpp \
  • trunk/src/VBox/Runtime/common/string/wcslen.asm

    r96336 r96373  
    3131;;
    3232; @param    psz     gcc: rdi  msc: rcx  x86: [esp+4]  wcall: eax
    33 RT_NOCRT_BEGINPROC strlen
     33RT_NOCRT_BEGINPROC wcslen
    3434        cld
    3535%ifdef RT_ARCH_AMD64
     
    5050        mov     xCX, -1
    5151        xor     eax, eax
    52         repne   scasb
     52        repne   scasw
    5353
    5454        ; found it
    5555        neg     xCX
    5656        lea     xAX, [xCX - 2]
     57        shr     xCX, 1
    5758%ifdef ASM_CALL64_MSC
    5859        mov     rdi, r9
    59 %endif
    60 %ifdef RT_ARCH_X86
     60%elifdef RT_ARCH_X86
    6161        mov     edi, edx
    6262%endif
    6363        ret
    64 ENDPROC RT_NOCRT(strlen)
     64ENDPROC RT_NOCRT(wcslen)
    6565
  • trunk/src/VBox/Runtime/testcase/Makefile.kmk

    r96338 r96373  
    582582        ../common/string/strcmp.asm \
    583583        ../common/string/strcpy.asm \
    584         ../common/string/strlen.asm
     584        ../common/string/strlen.asm \
     585        ../common/string/wcslen.asm
    585586
    586587tstRTNoCrt-2_TEMPLATE = VBOXR3TSTEXE
  • trunk/src/VBox/Runtime/testcase/tstNoCrt-1.cpp

    r93115 r96373  
    493493    cch = RT_NOCRT(strlen)(s_szTest3);      CHECK_CCH(sizeof(s_szTest3) - 1);
    494494
     495#ifdef _MSC_VER
     496    /*
     497     * Some simple wcslen checks.
     498     */
     499    RTPrintf("tstNoCrt-1: wcslen\n");
     500    cch = RT_NOCRT(wcslen)(L"");             CHECK_CCH(0);
     501    cch = RT_NOCRT(wcslen)(L"1");            CHECK_CCH(1);
     502    cch = RT_NOCRT(wcslen)(L"12");           CHECK_CCH(2);
     503    cch = RT_NOCRT(wcslen)(L"123");          CHECK_CCH(3);
     504    cch = RT_NOCRT(wcslen)(L"1234");         CHECK_CCH(4);
     505    cch = RT_NOCRT(wcslen)(L"12345");        CHECK_CCH(5);
     506#endif
     507
    495508    /*
    496509     * Summary.
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