Changeset 96043 in vbox
- Timestamp:
- Aug 4, 2022 10:08:07 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 152841
- Location:
- trunk
- Files:
-
- 1 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r96038 r96043 2336 2336 # bin2c (convert binary files into C arrays) 2337 2337 VBOX_BIN2C ?= $(PATH_OBJ)/bin2c/bin2c$(HOSTSUFF_EXE) 2338 2339 # genalias (generate aliases for nocrt_ functions) 2340 VBOX_GENALIAS ?= $(PATH_OBJ)/genalias/genalias$(HOSTSUFF_EXE) 2338 2341 2339 2342 # RTManifest (extension pack manifest utility) … … 6273 6276 endif 6274 6277 ifdef VBOX_WITH_NOCRT_STATIC 6275 TEMPLATE_VBOXR3STATIC_DEFS += RT_WITHOUT_NOCRT_WRAPPERS6276 6278 TEMPLATE_VBOXR3STATIC_CFLAGS = $(filter-out -MD$(VBOX_VCC_CRT_TYPE) -EHsc, $(TEMPLATE_VBOXR3EXE_CFLAGS)) -Zl -EHc-s- -Gy 6277 6279 TEMPLATE_VBOXR3STATIC_CXXFLAGS = $(filter-out -MD$(VBOX_VCC_CRT_TYPE) -EHsc, $(TEMPLATE_VBOXR3EXE_CXXFLAGS)) -Zl -EHc-s- -Gy … … 6489 6491 RT_NO_CRT \ 6490 6492 IN_RT_STATIC 6493 ifndef VBOX_WITH_NOCRT_STATIC 6491 6494 TEMPLATE_VBoxR3StaticNoCrt_DEFS.win = $(TEMPLATE_VBoxR3Static_DEFS.win) \ 6492 6495 RT_WITHOUT_NOCRT_WRAPPERS 6496 endif 6493 6497 TEMPLATE_VBoxR3StaticNoCrt_LIBS = \ 6494 6498 $(PATH_STAGE_LIB)/RuntimeR3NoCrt$(VBOX_SUFF_LIB) … … 8567 8571 RT_NO_CRT \ 8568 8572 IN_RT_STATIC 8573 ifndef VBOX_WITH_NOCRT_STATIC 8569 8574 TEMPLATE_VBoxGuestR3NoCrtExe_DEFS.win = $(TEMPLATE_VBoxGuestR3Exe_DEFS.win) \ 8570 8575 RT_WITHOUT_NOCRT_WRAPPERS 8576 endif 8571 8577 TEMPLATE_VBoxGuestR3NoCrtExe_LIBS = \ 8572 8578 $(PATH_STAGE_LIB)/RuntimeR3NoCrt$(VBOX_SUFF_LIB) -
trunk/include/iprt/asmdefs.mac
r96015 r96043 1113 1113 ; Starts a NOCRT procedure, taking care of name wrapping and aliasing. 1114 1114 ; 1115 ; Aliasing (weak ones, if supported) will be created when RT_WITH_NOCRT_ALIASES 1116 ; is defined and RT_WITHOUT_NOCRT_WRAPPERS isn't. 1115 ; Weak aliases for regular crt (%1) names to the nocrt_ prefixed ones will be 1116 ; added when RT_WITH_NOCRT_ALIASES is defined and the output is ELF. If 1117 ; RT_WITH_GENALIAS_NOCRT_ALIASES is undefined, strong aliases will be added for 1118 ; for non-ELF targets, otherwise it's assumed the genalias build tool will do 1119 ; the weak aliasing for us. 1117 1120 ; 1118 1121 %macro RT_NOCRT_BEGINPROC 1 … … 1120 1123 BEGINPROC_EXPORTED RT_NOCRT(%1) 1121 1124 %ifdef ASM_FORMAT_ELF 1125 ; ELF 1122 1126 %ifdef RT_WITH_NOCRT_UNDERSCORE_ALIASES 1123 1127 global NAME(_ %+ %1):function … … 1128 1132 weak NAME(%1) 1129 1133 SAFE_LABEL NAME(%1) 1130 %else 1134 1135 %elifndef RT_WITH_GENALIAS_NOCRT_ALIASES 1136 ; non-ELF when not using genalias. 1137 %ifdef RT_WITH_NOCRT_UNDERSCORE_ALIASES 1138 GLOBALNAME _%1 1139 %endif 1131 1140 GLOBALNAME %1 1132 1141 %endif … … 1135 1144 %endif ; !RT_WITH_NOCRT_ALIASES 1136 1145 %endmacro ; RT_NOCRT_BEGINPROC 1137 1138 %ifdef RT_WITH_NOCRT_ALIASES1139 %ifdef RT_WITHOUT_NOCRT_WRAPPERS1140 %error "RT_WITH_NOCRT_ALIASES and RT_WITHOUT_NOCRT_WRAPPERS doesn't mix."1141 %endif1142 %endif1143 1146 1144 1147 -
trunk/src/VBox/Additions/3D/Config.kmk
r96012 r96043 78 78 ifdef VBOX_WITH_NOCRT_STATIC 79 79 TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS += \ 80 IPRT_NO_CRT_FOR_3RD_PARTY 80 IPRT_NO_CRT_FOR_3RD_PARTY \ 81 RT_WITHOUT_NOCRT_WRAPPERS \ 82 RT_WITHOUT_NOCRT_WRAPPER_ALIASES 81 83 endif 82 84 TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS.win = $(TEMPLATE_NewerVccVBoxGuestR3Dll_DEFS.win) \ -
trunk/src/VBox/Runtime/Makefile.kmk
r96016 r96043 1708 1708 1709 1709 # 1710 # kBuild unit for generating nocrt aliases. 1711 # 1712 # This scans assembly, C and C++ source files for the target looking for macros 1713 # that defines functions and variables needing aliasing. 1714 # 1715 UNIT_VBoxNoCrtAliases = CRT symbol alias for the rtnocr_xxx implementations 1716 define def_unit_VBoxNoCrtAliases_double_expansion 1717 $$($(target)_2_VBOX_NOCRT_ALIAS_KMK_FILE): \ 1718 $$(abspathex \ 1719 $$($(target)_SOURCES)\ 1720 $$($(target)_SOURCES.$(bld_trg))\ 1721 $$($(target)_SOURCES.$(bld_trg).$(bld_type))\ 1722 $$($(target)_SOURCES.$(bld_trg).$(bld_trg_arch))\ 1723 $$($(target)_SOURCES.$(bld_trg).$(bld_trg_arch).$(bld_type))\ 1724 $$($(target)_SOURCES.$(bld_trg_arch))\ 1725 $$($(target)_SOURCES.$(bld_trg_cpu))\ 1726 $$($(target)_SOURCES.$(bld_type)) \ 1727 , $(firstfile $(defpath) $(PATH_SUB_CURRENT))) \ 1728 $$(VBOX_PATH_RUNTIME_SRC)//nocrt-aliases.sed \ 1729 | $$$$(dir $$$$@) 1730 $$(call MSG_GENERATE,$(target),$$@,) 1731 $$(QUIET)$$(APPEND) -tn "$$@" "$(target)_2_VBOX_NOCRT_ALIASES := \\" 1732 $$(xargs $$(QUIET)$$(SED) -rn -f "$$(VBOX_PATH_RUNTIME_SRC)/nocrt-aliases.sed" --append "$$@" , $$(filter %.c %.cpp %.asm, $$^) ) 1733 $$(QUIET)$$(APPEND) -n "$$@" "" "" 1734 1735 $$($(target)_0_OUTDIR)/genalias/genalias.ts + $$($(target)_2_VBOX_NOCRT_ALIAS_FILES): | $$(VBOX_GENALIAS) 1736 $$(call MSG_GENERATE,$(target),$$@,) 1737 $$(QUIET)$$(MKDIR) -p -- "$$($(target)_0_OUTDIR)/genalias/" 1738 $$(QUIET)$$(VBOX_GENALIAS) -f $$(if-expr "$(bld_trg)" == "win",coff,$$(if-expr "$(bld_trg)" == "darwin",macho,omf)) \ 1739 -D "$$($(target)_0_OUTDIR)/genalias/" $$($(target)_2_VBOX_NOCRT_ALIASES) 1740 $$(QUIET)$$(APPEND) -tn "$$($(target)_0_OUTDIR)/genalias/genalias.ts" "$$($(target)_2_VBOX_NOCRT_ALIASES))" 1741 1742 $(target)_2_OBJS += $$($(target)_2_VBOX_NOCRT_ALIAS_FILES) 1743 OTHER_CLEAN += $$($(target)_2_VBOX_NOCRT_ALIAS_KMK_FILE) $$($(target)_2_VBOX_NOCRT_ALIAS_KMK_FILE).ts 1744 endef 1745 1746 define def_unit_VBoxNoCrtAliases_target_pre 1747 if1of ($(bld_trg), win os2 darwin) # Only non-ELF targets as ELF does not support aliasing. 1748 $(target)_2_VBOX_NOCRT_ALIAS_KMK_FILE := $(PATH_OUT)/nocrt-aliases-$(target).kmk 1749 include $($(target)_2_VBOX_NOCRT_ALIAS_KMK_FILE) 1750 $(target)_2_VBOX_NOCRT_ALIAS_FILES := \ 1751 $(foreach alias,$($(target)_2_VBOX_NOCRT_ALIASES), $($(target)_0_OUTDIR)/genalias/$(firstword $(subst =, $(SPACE),$(alias))).o) 1752 $(eval $(def_unit_VBoxNoCrtAliases_double_expansion)) 1753 endif 1754 endef 1755 1756 1757 # 1710 1758 # RuntimeR3 - Static Runtime for Ring-3 executables. 1711 1759 # … … 1714 1762 ifdef VBOX_WITH_NOCRT_STATIC 1715 1763 if1of ($(KBUILD_TARGET), win) 1764 RuntimeR3_USES = $(RuntimeBaseR3_USES) VBoxNoCrtAliases 1765 RuntimeR3_DEFS += $(filter-out RT_WITHOUT_NOCRT_WRAPPERS,$(RuntimeBaseR3_DEFS)) \ 1766 RT_FORCE_NOCRT_WRAPPERS \ 1767 RT_WITH_NOCRT_ALIASES RT_WITH_NOCRT_UNDERSCORE_ALIASES RT_WITH_GENALIAS_NOCRT_ALIASES 1768 1716 1769 RuntimeR3_SOURCES = $(filter-out \ 1717 1770 r3/alloc.cpp \ -
trunk/src/VBox/Runtime/common/string/memchr.cpp
r93115 r96043 29 29 * Header Files * 30 30 *********************************************************************************************************************************/ 31 #include "internal/iprt.h" 31 32 #include <iprt/string.h> 32 33 … … 41 42 * @param cb The size of the block. 42 43 */ 43 #ifdef _MSC_VER /* Silly 'safeness' from MS. */44 # if _MSC_VER >= 140045 _CRTIMP __checkReturn _CONST_RETURN void * __cdecl memchr( __in_bcount_opt(_MaxCount) const void * pv, __in int ch, __insize_t cb)46 # else47 void *memchr(const void *pv, int ch, size_t cb) 48 # endif 44 #ifdef IPRT_NO_CRT 45 # undef memchr 46 void *RT_NOCRT(memchr)(const void *pv, int ch, size_t cb) 47 #elif RT_MSC_PREREQ(RT_MSC_VER_VS2005) 48 _CRTIMP __checkReturn _CONST_RETURN void * __cdecl 49 memchr(__in_bcount_opt(_MaxCount) const void *pv, __in int ch, __in size_t cb) 49 50 #else 50 51 void *memchr(const void *pv, int ch, size_t cb) … … 61 62 return NULL; 62 63 } 64 RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(memchr); 63 65 -
trunk/src/VBox/Runtime/common/string/memcmp.cpp
r93115 r96043 29 29 * Header Files * 30 30 *********************************************************************************************************************************/ 31 #include "internal/iprt.h" 31 32 #include <iprt/string.h> 32 #include <iprt/types.h>33 33 34 34 … … 44 44 * @param cb The size of the block. 45 45 */ 46 #ifdef _MSC_VER47 # if _MSC_VER >= 140048 __checkReturn int __cdecl memcmp(__in_bcount_opt(_Size) const void * pvDst, __in_bcount_opt(_Size) const void * pvSrc, __insize_t cb)49 # else50 int __cdecl memcmp(const void *pvDst, const void *pvSrc, size_t cb) 51 # endif 46 #ifdef IPRT_NO_CRT 47 # undef memcmp 48 int RT_NOCRT(memcmp)(const void *pvDst, const void *pvSrc, size_t cb) 49 #elif RT_MSC_PREREQ(RT_MSC_VER_VS2005) 50 __checkReturn int __cdecl 51 memcmp(__in_bcount_opt(_Size) const void *pvDst, __in_bcount_opt(_Size) const void *pvSrc, __in size_t cb) 52 52 #else 53 53 int memcmp(const void *pvDst, const void *pvSrc, size_t cb) … … 84 84 return 0; 85 85 } 86 RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(memcmp); 86 87 -
trunk/src/VBox/Runtime/common/string/memcpy.cpp
r93115 r96043 29 29 * Header Files * 30 30 *********************************************************************************************************************************/ 31 #include "internal/iprt.h" 31 32 #include <iprt/string.h> 32 33 … … 40 41 * @param cb The size of the block. 41 42 */ 42 #ifdef _MSC_VER43 # if _MSC_VER >= 140044 _CRT_INSECURE_DEPRECATE_MEMORY(memcpy_s) void * __cdecl memcpy(__out_bcount_full_opt(_Size) void * pvDst, __in_bcount_opt(_Size) const void * pvSrc, __insize_t cb)45 # else46 void *memcpy(void *pvDst, const void *pvSrc, size_t cb) 47 # endif 43 #ifdef IPRT_NO_CRT 44 # undef memcpy 45 void *RT_NOCRT(memcpy)(void *pvDst, const void *pvSrc, size_t cb) 46 #elif RT_MSC_PREREQ(RT_MSC_VER_VS2005) 47 _CRT_INSECURE_DEPRECATE_MEMORY(memcpy_s) void * __cdecl 48 memcpy(__out_bcount_full_opt(_Size) void *pvDst, __in_bcount_opt(_Size) const void *pvSrc, __in size_t cb) 48 49 #else 49 50 void *memcpy(void *pvDst, const void *pvSrc, size_t cb) … … 78 79 return pvDst; 79 80 } 81 RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(memcpy); 80 82 -
trunk/src/VBox/Runtime/common/string/mempcpy.cpp
r93959 r96043 29 29 * Header Files * 30 30 *********************************************************************************************************************************/ 31 #include "internal/iprt.h" 31 32 #include <iprt/string.h> 32 33 33 34 35 #ifdef IPRT_NO_CRT 36 # undef mempcpy 37 void * RT_NOCRT(mempcpy)(void *pvDst, const void *pvSrc, size_t cb) 38 #else 34 39 RTDECL(void *) mempcpy(void *pvDst, const void *pvSrc, size_t cb) 40 #endif 35 41 { 36 42 return (char *)memcpy(pvDst, pvSrc, cb) + cb; 37 43 } 44 RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(mempcpy); 38 45 -
trunk/src/VBox/Runtime/common/string/memrchr.cpp
r93115 r96043 29 29 * Header Files * 30 30 *********************************************************************************************************************************/ 31 #include "internal/iprt.h" 31 32 #include <iprt/string.h> 32 33 … … 40 41 * @param cb The size of the block. 41 42 */ 42 void *memrchr(const void *pv, int ch, size_t cb) 43 #undef memrchr 44 void *RT_NOCRT(memrchr)(const void *pv, int ch, size_t cb) 43 45 { 44 46 if (cb) … … 57 59 return NULL; 58 60 } 61 RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(memrchr); 59 62 -
trunk/src/VBox/Runtime/common/string/memset.cpp
r93115 r96043 29 29 * Header Files * 30 30 *********************************************************************************************************************************/ 31 #include "internal/iprt.h" 31 32 #include <iprt/string.h> 32 33 … … 40 41 * @param cb The size of the block. 41 42 */ 43 #undef memset 42 44 #ifdef _MSC_VER 43 45 # if _MSC_VER >= 1400 44 void * __cdecl memset(__out_bcount_full_opt(_Size) void *pvDst, __in int ch, __in size_t cb)46 void * __cdecl RT_NOCRT(memset)(__out_bcount_full_opt(_Size) void *pvDst, __in int ch, __in size_t cb) 45 47 # else 46 void * memset(void *pvDst, int ch, size_t cb)48 void *RT_NOCRT(memset)(void *pvDst, int ch, size_t cb) 47 49 # endif 48 50 #else 49 void * memset(void *pvDst, int ch, size_t cb)51 void *RT_NOCRT(memset)(void *pvDst, int ch, size_t cb) 50 52 #endif 51 53 { … … 72 74 return pvDst; 73 75 } 74 76 RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(memset); -
trunk/src/VBox/Runtime/common/string/strchr.cpp
r93137 r96043 25 25 */ 26 26 27 28 /********************************************************************************************************************************* 29 * Header Files * 30 *********************************************************************************************************************************/ 31 #include "internal/iprt.h" 27 32 #include <iprt/string.h> 28 33 34 #ifdef IPRT_NO_CRT 35 # undef strchr 36 char *RT_NOCRT(strchr)(const char *pszStr, int ch) 29 37 #ifdef _MSC_VER 30 _CRTIMP char * __cdecl strchr 38 _CRTIMP char * __cdecl strchr(const char *pszStr, int ch) 31 39 #elif defined(__WATCOMC__) && !defined(IPRT_NO_CRT) 32 _WCRTLINK char *std::strchr 40 _WCRTLINK char *std::strchr(const char *pszStr, int ch) 33 41 #else 34 char *strchr 35 #endif 36 (const char *pszStr, int ch) 37 #if defined(__THROW) && !defined(RT_OS_WINDOWS) && !defined(RT_OS_OS2) 42 char *strchr(const char *pszStr, int ch) 43 # if defined(__THROW) && !defined(RT_OS_WINDOWS) && !defined(RT_OS_OS2) 38 44 __THROW 45 # endif 39 46 #endif 40 47 { … … 47 54 return NULL; 48 55 } 56 RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(strchr); 49 57 -
trunk/src/VBox/Runtime/common/string/strcpy.cpp
r93115 r96043 29 29 * Header Files * 30 30 *********************************************************************************************************************************/ 31 #include "internal/iprt.h" 31 32 #include <iprt/string.h> 32 33 … … 39 40 * @param pszSrc Zero terminated string. 40 41 */ 41 char* strcpy(char *pszDst, const char *pszSrc) 42 #ifdef IPRT_NO_CRT 43 # undef strlen 44 char *RT_NOCRT(strcpy)(char *pszDst, const char *pszSrc) 45 #else 46 char *strcpy(char *pszDst, const char *pszSrc) 47 #endif 42 48 { 43 char * psz= pszDst;44 while ((*psz ++ = *pszSrc++))45 ;49 char * const pszRet = pszDst; 50 while ((*pszDst = *pszSrc++) != '\0') 51 pszDst++; 46 52 47 return psz Dst;53 return pszRet; 48 54 } 55 RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(strcpy); 56 -
trunk/src/VBox/Runtime/common/string/strcspn.cpp
r95814 r96043 29 29 * Header Files * 30 30 *********************************************************************************************************************************/ 31 #include "internal/iprt.h" 31 32 #include <iprt/string.h> 32 33 … … 35 36 * strpbrk with a offset return instead of a pointer. 36 37 */ 37 size_t strcspn(const char *pszString, const char *pszBreakChars) 38 #undef strcspn 39 size_t RT_NOCRT(strcspn)(const char *pszString, const char *pszBreakChars) 38 40 { 39 41 const char * const pszStringStart = pszString; … … 50 52 return (size_t)(pszString - pszStringStart); 51 53 } 54 RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(strcspn); 52 55 -
trunk/src/VBox/Runtime/common/string/strformat.cpp
r95932 r96043 83 83 * @param cchMax Max length. 84 84 */ 85 static unsigned _strnlen(const char *psz, unsigned cchMax)85 static unsigned rtStrFormatStrNLen(const char *psz, unsigned cchMax) 86 86 { 87 87 const char *pszC = psz; … … 100 100 * @param cchMax Max length. 101 101 */ 102 static unsigned _strnlenUtf16(PCRTUTF16 pwsz, unsigned cchMax)102 static unsigned rtStrFormatStrNLenUtf16(PCRTUTF16 pwsz, unsigned cchMax) 103 103 { 104 104 #ifdef IN_RING3 … … 131 131 * @param cchMax Max length. 132 132 */ 133 static unsigned _strnlenUni(PCRTUNICP pusz, unsigned cchMax)133 static unsigned rtStrFormatStrNLenUni(PCRTUNICP pusz, unsigned cchMax) 134 134 { 135 135 PCRTUNICP puszC = pusz; … … 547 547 if (RT_VALID_PTR(pwszStr)) 548 548 { 549 int cwcStr = _strnlenUtf16(pwszStr, (unsigned)cchPrecision);549 int cwcStr = rtStrFormatStrNLenUtf16(pwszStr, (unsigned)cchPrecision); 550 550 if (!(fFlags & RTSTR_F_LEFT)) 551 551 while (--cchWidth >= cwcStr) … … 579 579 if (RT_VALID_PTR(puszStr)) 580 580 { 581 int cchStr = _strnlenUni(puszStr, (unsigned)cchPrecision);581 int cchStr = rtStrFormatStrNLenUni(puszStr, (unsigned)cchPrecision); 582 582 if (!(fFlags & RTSTR_F_LEFT)) 583 583 while (--cchWidth >= cchStr) … … 608 608 if (RT_VALID_PTR(pszStr)) 609 609 { 610 int cchStr = _strnlen(pszStr, (unsigned)cchPrecision);610 int cchStr = rtStrFormatStrNLen(pszStr, (unsigned)cchPrecision); 611 611 if (!(fFlags & RTSTR_F_LEFT)) 612 612 while (--cchWidth >= cchStr) -
trunk/src/VBox/Runtime/common/string/strlen.cpp
r93115 r96043 29 29 * Header Files * 30 30 *********************************************************************************************************************************/ 31 #include "internal/iprt.h" 31 32 #include <iprt/string.h> 32 33 … … 38 39 * @param pszString Zero terminated string. 39 40 */ 40 #ifdef _MSC_VER 41 # if _MSC_VER >= 1400 41 #ifdef IPRT_NO_CRT 42 # undef strlen 43 size_t strlen(const char *pszString) 44 #elif RT_MSC_PREREQ(RT_MSC_VER_VS2005) 42 45 __checkReturn size_t __cdecl strlen(__in_z const char *pszString) 43 # else44 size_t strlen(const char *pszString)45 # endif46 46 #else 47 47 size_t strlen(const char *pszString) … … 53 53 return psz - pszString; 54 54 } 55 RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(strlen); 55 56 -
trunk/src/VBox/Runtime/common/string/strncmp.cpp
r93135 r96043 25 25 */ 26 26 27 28 /********************************************************************************************************************************* 29 * Header Files * 30 *********************************************************************************************************************************/ 31 #include "internal/iprt.h" 27 32 #include <iprt/string.h> 28 33 29 #ifdef _MSC_VER 30 _CRTIMP int __cdecl strncmp 34 #ifdef IPRT_NO_CRT 35 # undef strncmp 36 int RT_NOCRT(strncmp)(const char *pszStr1, const char *pszStr2, size_t cb) 37 #elif defined( _MSC_VER) 38 _CRTIMP int __cdecl strncmp(const char *pszStr1, const char *pszStr2, size_t cb) 31 39 #elif defined(__WATCOMC__) && !defined(IPRT_NO_CRT) 32 _WCRTLINK int std::strncmp 40 _WCRTLINK int std::strncmp(const char *pszStr1, const char *pszStr2, size_t cb) 33 41 #else 34 int strncmp 35 #endif 36 (const char *pszStr1, const char *pszStr2, size_t cb) 37 #if defined(__THROW) && !defined(RT_OS_WINDOWS) && !defined(RT_OS_OS2) 42 int strncmp(const char *pszStr1, const char *pszStr2, size_t cb) 43 # if defined(__THROW) && !defined(RT_OS_WINDOWS) && !defined(RT_OS_OS2) 38 44 __THROW 45 # endif 39 46 #endif 40 47 { … … 50 57 return 0; 51 58 } 59 RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(strncmp); 60 -
trunk/src/VBox/Runtime/common/string/strpbrk.cpp
r95767 r96043 29 29 * Header Files * 30 30 *********************************************************************************************************************************/ 31 #include "internal/iprt.h" 31 32 #include <iprt/string.h> 32 33 … … 38 39 */ 39 40 #ifdef IPRT_NO_CRT 40 char *strpbrk(const char *pszStr, const char *pszBreakChars) 41 # undef strpbrk 42 char *RT_NOCRT(strpbrk)(const char *pszStr, const char *pszBreakChars) 41 43 #elif defined(_MSC_VER) 42 44 # if _MSC_VER >= 1400 … … 66 68 return NULL; 67 69 } 70 RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(strpbrk); 68 71 -
trunk/src/VBox/Runtime/common/string/strrchr.cpp
r95814 r96043 29 29 * Header Files * 30 30 *********************************************************************************************************************************/ 31 #include "internal/iprt.h" 31 32 #include <iprt/string.h> 32 33 33 34 34 char *strrchr(const char *pszString, int ch) 35 #undef strrchr 36 char *RT_NOCRT(strrchr)(const char *pszString, int ch) 35 37 { 36 /* * @todo check out what strrchr(psz, '\\0') is supposed to return. */37 return (char *)memrchr(pszString, ch, strlen(pszString) );38 /* We must search the terminator too, so strrchr(str, '\0') returns a pointer to it. */ 39 return (char *)memrchr(pszString, ch, strlen(pszString) + 1); 38 40 } 41 RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(strrchr); 39 42 -
trunk/src/VBox/Runtime/common/string/strstr.cpp
r95814 r96043 29 29 * Header Files * 30 30 *********************************************************************************************************************************/ 31 #include "internal/iprt.h" 31 32 #include <iprt/string.h> 32 33 … … 40 41 * @param pszSubStr The substring to search for. 41 42 */ 42 char *strstr(const char *pszString, const char *pszSubStr) 43 #undef strstr 44 char *RT_NOCRT(strstr)(const char *pszString, const char *pszSubStr) 43 45 { 44 46 char const ch0Sub = *pszSubStr; … … 59 61 return NULL; 60 62 } 63 RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(strstr); 61 64 -
trunk/src/VBox/Runtime/include/internal/iprt.h
r93115 r96043 64 64 #endif 65 65 66 /** @def RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL 67 * Creates symbol alias and export a RT_NOCRT symbol. 68 * 69 * For targets using ELF this macro generates weak symbol aliases, for the other 70 * object formats the makefile scans source files for this macro and produces 71 * separate object files with the aliases. 72 * 73 * @param a_Name The CRT function or variable name. 74 * 75 * @todo Does not support ELF targets using underscore prefixed symbols. 76 */ 77 #if defined(__ELF__) && defined(RT_WITH_NOCRT_ALIASES) && !defined(RT_WITHOUT_NOCRT_ALIASES) 78 # ifdef RT_WITH_NOCRT_UNDERSCORE_ALIASES 79 # define RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(a_Name) RT_EXPORT_SYMBOL(a_Name) \ 80 __asm__(".weak " #a_Name "\n\t" \ 81 ".set " #a_Name "," RT_NOCRT_STR(a_Name) "\n\t" \ 82 ".weak _" #a_Name "\n\t" \ 83 ".set _" #a_Name "," RT_NOCRT_STR(a_Name) "\n\t") 84 # else 85 # define RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(a_Name) RT_EXPORT_SYMBOL(a_Name) \ 86 __asm__(".weak " #a_Name "\n\t" \ 87 ".set " #a_Name "," RT_NOCRT_STR(a_Name) "\n\t") 88 # endif 89 #else 90 # define RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(a_Name) RT_EXPORT_SYMBOL(a_Name) 91 #endif 92 93 /** @def RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL_WITHOUT_UNDERSCORE 94 * Variant of RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL that omits the 95 * underscore-prefixed variant of the symbol. 96 * 97 * @param a_Name The CRT function or variable name. 98 */ 99 #if defined(__ELF__) && defined(RT_WITH_NOCRT_ALIASES) && !defined(RT_WITHOUT_NOCRT_ALIASES) 100 # define RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL_WITHOUT_UNDERSCORE(a_Name) RT_EXPORT_SYMBOL(a_Name) \ 101 __asm__(".weak " #a_Name "\n\t" \ 102 ".set " #a_Name "," RT_NOCRT_STR(a_Name) "\n\t") 103 #else 104 # define RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL_WITHOUT_UNDERSCORE(a_Name) RT_EXPORT_SYMBOL(a_Name) 105 #endif 106 66 107 67 108 /** @def RT_MORE_STRICT
Note:
See TracChangeset
for help on using the changeset viewer.