Changeset 1174 in vbox for trunk/src/VBox/Runtime/string/strchr_alias.c
- Timestamp:
- Mar 3, 2007 11:49:53 PM (18 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/string/strchr_alias.c
r1060 r1174 1 1 /* $Id: $ */ 2 2 /** @file 3 * InnoTek Portable Runtime - No-CRT memchr() alias for gcc.3 * InnoTek Portable Runtime - No-CRT strchr() alias for gcc. 4 4 */ 5 5 … … 25 25 *******************************************************************************/ 26 26 #include <iprt/nocrt/string.h> 27 #undef memchr27 #undef strchr 28 28 29 29 #if defined(__DARWIN__) || defined(__WIN__) 30 30 # ifndef __MINGW32__ 31 # pragma weak memchr31 # pragma weak strchr 32 32 # endif 33 33 34 34 /* No alias support here (yet in the ming case). */ 35 extern void *(memchr)(const void *pv, int ch, size_t cb)35 extern char *(strchr)(const char *psz, int ch) 36 36 { 37 return RT_NOCRT( memchr)(pv, ch, cb);37 return RT_NOCRT(strchr)(pv, ch); 38 38 } 39 39 40 40 #elif __GNUC__ >= 4 41 41 /* create a weak alias. */ 42 __asm__(".weak memchr\t\n"43 " .set memchr," RT_NOCRT_STR(memchr) "\t\n");42 __asm__(".weak strchr\t\n" 43 " .set strchr," RT_NOCRT_STR(strchr) "\t\n"); 44 44 #else 45 45 /* create a weak alias. */ 46 extern __typeof(RT_NOCRT( memchr)) memchr __attribute__((weak, alias(RT_NOCRT_STR(memchr))));46 extern __typeof(RT_NOCRT(strchr)) strchr __attribute__((weak, alias(RT_NOCRT_STR(strchr)))); 47 47 #endif 48 48
Note:
See TracChangeset
for help on using the changeset viewer.