strchr_alias.c revision c38dcd5b2fbcbaab170a1014a621343c4cf94391
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync/* $Id$ */
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync/** @file
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * IPRT - No-CRT strlen() alias for gcc.
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync */
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync/*
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * Copyright (C) 2006-2008 Sun Microsystems, Inc.
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync *
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * available from http://www.virtualbox.org. This file is free software;
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * you can redistribute it and/or modify it under the terms of the GNU
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * General Public License (GPL) as published by the Free Software
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync *
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * The contents of this file may alternatively be used under the terms
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * of the Common Development and Distribution License Version 1.0
4237d5a79f48789aacc67dc43378d2d7813a39f4vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
4237d5a79f48789aacc67dc43378d2d7813a39f4vboxsync * VirtualBox OSE distribution, in which case the provisions of the
4237d5a79f48789aacc67dc43378d2d7813a39f4vboxsync * CDDL are applicable instead of those of the GPL.
4237d5a79f48789aacc67dc43378d2d7813a39f4vboxsync *
4237d5a79f48789aacc67dc43378d2d7813a39f4vboxsync * You may elect to license modified versions of this file under the
4237d5a79f48789aacc67dc43378d2d7813a39f4vboxsync * terms and conditions of either the GPL or the CDDL or both.
4237d5a79f48789aacc67dc43378d2d7813a39f4vboxsync *
4237d5a79f48789aacc67dc43378d2d7813a39f4vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
4237d5a79f48789aacc67dc43378d2d7813a39f4vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync * additional information or have any questions.
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync */
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync/*******************************************************************************
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync* Header Files *
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync*******************************************************************************/
058c0c53c37f5cb271aeb3c385c10766f84f4aefvboxsync#include <iprt/nocrt/string.h>
#undef strlen
#if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS)
# ifndef __MINGW32__
# pragma weak strlen
# endif
/* No alias support here (yet in the ming case). */
extern char *(strlen)(const char *psz, int ch)
{
return RT_NOCRT(strlen)(psz, ch);
}
#elif __GNUC__ >= 4
/* create a weak alias. */
__asm__(".weak strlen\t\n"
" .set strlen," RT_NOCRT_STR(strlen) "\t\n");
#else
/* create a weak alias. */
extern __typeof(RT_NOCRT(strlen)) strlen __attribute__((weak, alias(RT_NOCRT_STR(strlen))));
#endif