forked from len0rd/rockbox
Add mempcpy implementation
A GNU extension that returns dst + size instead of dst. It's a nice shortcut when copying strings with a known size or back-to-back blocks and you have to do it often. May of course be called directly or alternately through __builtin_mempcpy in some compiler versions. For ASM on native targets, it is implemented as an alternate entrypoint to memcpy which adds minimal code and overhead. Change-Id: I4cbb3483f6df3c1007247fe0a95fd7078737462b
This commit is contained in:
parent
7d1a47cf13
commit
77b3625763
8 changed files with 99 additions and 4 deletions
|
@ -18,8 +18,8 @@
|
|||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#ifndef STRING_EXTRA_H
|
||||
#define STRING_EXTRA_H
|
||||
#include <string.h>
|
||||
#include "strlcpy.h"
|
||||
#include "strlcat.h"
|
||||
|
@ -27,3 +27,11 @@
|
|||
#include "strcasestr.h"
|
||||
#include "strtok_r.h"
|
||||
#include "memset16.h"
|
||||
|
||||
#if defined(WIN32) || defined(APPLICATION)
|
||||
#ifndef mempcpy
|
||||
#define mempcpy __builtin_mempcpy
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* STRING_EXTRA_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue