Renamed defines UNALIGNED to ROCKBOX_UNALIGNED - UNALIGNED is already

defined in mingw environments.

Renamed defines of UNALIGNED to ROCKBOX_UNALIGNED so that they don't
conflict with definitions in mingw32 cross-compiling environments
(defined in _mingw.h).

Change-Id: I369848c0f507e6bf5ff9ab4a60663bbbda6edc52
This commit is contained in:
Matthias Mohr 2017-01-15 13:29:40 +01:00 committed by Amaury Pouly
parent 955be5b34a
commit d984725cbf
12 changed files with 24 additions and 24 deletions

View File

@ -46,7 +46,7 @@ QUICKREF
/*SUPPRESS 530*/
/* Nonzero if either X or Y is not aligned on a "long" boundary. */
#define UNALIGNED(X, Y) \
#define ROCKBOX_UNALIGNED(X, Y) \
(((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
#if LONG_MAX == 2147483647L
@ -95,7 +95,7 @@ _DEFUN (strncpy, (dst0, src0),
_CONST long *aligned_src;
/* If SRC and DEST is aligned and count large enough, then copy words. */
if (!UNALIGNED (src, dst) && !TOO_SMALL (count))
if (!ROCKBOX_UNALIGNED (src, dst) && !TOO_SMALL (count))
{
aligned_dst = (long*)dst;
aligned_src = (long*)src;

View File

@ -37,7 +37,7 @@ QUICKREF
#include <string.h>
/* Nonzero if either X or Y is not aligned on a "long" boundary. */
#define UNALIGNED(X, Y) \
#define ROCKBOX_UNALIGNED(X, Y) \
(((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
/* How many bytes are copied each iteration of the 4X unrolled loop. */
@ -82,7 +82,7 @@ _DEFUN (memcpy, (dst0, src0, len0),
/* If the size is small, or either SRC or DST is unaligned,
then punt into the byte copy loop. This should be rare. */
if (!TOO_SMALL(len) && !UNALIGNED (src, dst))
if (!TOO_SMALL(len) && !ROCKBOX_UNALIGNED (src, dst))
{
aligned_dst = (long*)dst;
aligned_src = (long*)src;

View File

@ -40,7 +40,7 @@ QUICKREF
#include <string.h>
/* Nonzero if either X or Y is not aligned on a "long" boundary. */
#define UNALIGNED(X, Y) \
#define ROCKBOX_UNALIGNED(X, Y) \
(((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
/* How many bytes are copied each iteration of the 4X unrolled loop. */
@ -109,7 +109,7 @@ _DEFUN (memmove, (dst_void, src_void, length),
/* Use optimizing algorithm for a non-destructive copy to closely
match memcpy. If the size is small or either SRC or DST is unaligned,
then punt into the byte copy loop. This should be rare. */
if (!TOO_SMALL(len) && !UNALIGNED (src, dst))
if (!TOO_SMALL(len) && !ROCKBOX_UNALIGNED (src, dst))
{
aligned_dst = (long*)dst;
aligned_src = (long*)src;

View File

@ -37,7 +37,7 @@ QUICKREF
#include "_ansi.h"
#define LBLOCKSIZE (sizeof(long))
#define UNALIGNED(X) ((long)X & (LBLOCKSIZE - 1))
#define ROCKBOX_UNALIGNED(X) ((long)X & (LBLOCKSIZE - 1))
#define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE)
_PTR
@ -61,7 +61,7 @@ _DEFUN (memset, (m, c, n),
unsigned long buffer;
unsigned long *aligned_addr;
if (!TOO_SMALL (n) && !UNALIGNED (m))
if (!TOO_SMALL (n) && !ROCKBOX_UNALIGNED (m))
{
/* If we get this far, we know that n is large and m is word-aligned. */

View File

@ -22,7 +22,7 @@
#include "string-extra.h" /* memset16() */
#define LBLOCKSIZE (sizeof(long)/2)
#define UNALIGNED(X) ((long)X & (sizeof(long) - 1))
#define ROCKBOX_UNALIGNED(X) ((long)X & (sizeof(long) - 1))
#define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE)
void memset16(void *dst, int val, size_t len)
@ -38,7 +38,7 @@ void memset16(void *dst, int val, size_t len)
unsigned long buffer;
unsigned long *aligned_addr;
if (!TOO_SMALL(len) && !UNALIGNED(dst))
if (!TOO_SMALL(len) && !ROCKBOX_UNALIGNED(dst))
{
aligned_addr = (unsigned long *)dst;

View File

@ -37,7 +37,7 @@ QUICKREF
#include <limits.h>
#define LBLOCKSIZE (sizeof (long))
#define UNALIGNED(X) ((long)X & (LBLOCKSIZE - 1))
#define ROCKBOX_UNALIGNED(X) ((long)X & (LBLOCKSIZE - 1))
#if LONG_MAX == 2147483647L
#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
@ -73,7 +73,7 @@ _DEFUN (strlen, (str),
_CONST char *start = str;
unsigned long *aligned_addr;
if (!UNALIGNED (str))
if (!ROCKBOX_UNALIGNED (str))
{
/* If the string is word-aligned, we can check for the presence of
a null in each word-sized block. */

View File

@ -38,7 +38,7 @@ QUICKREF
#include "_ansi.h" /* for _DEFUN */
/* Nonzero if X is not aligned on a "long" boundary. */
#define UNALIGNED(X) ((long)X & (sizeof (long) - 1))
#define ROCKBOX_UNALIGNED(X) ((long)X & (sizeof (long) - 1))
/* How many bytes are loaded each iteration of the word copy loop. */
#define LBLOCKSIZE (sizeof (long))
@ -82,7 +82,7 @@ _DEFUN (memchr, (s1, i, n),
unsigned long mask,j;
unsigned long *aligned_addr;
if (!UNALIGNED (s))
if (!ROCKBOX_UNALIGNED (s))
{
mask = 0;
for (j = 0; j < LBLOCKSIZE; j++)

View File

@ -40,7 +40,7 @@ QUICKREF
#include "_ansi.h" /* for _DEFUN */
/* Nonzero if either X or Y is not aligned on a "long" boundary. */
#define UNALIGNED(X, Y) \
#define ROCKBOX_UNALIGNED(X, Y) \
(((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
/* How many bytes are copied each iteration of the word copy loop. */
@ -78,7 +78,7 @@ _DEFUN (memcmp, (m1, m2, n),
/* If the size is too small, or either pointer is unaligned,
then we punt to the byte compare loop. Hopefully this will
not turn up in inner loops. */
if (!TOO_SMALL(n) && !UNALIGNED(s1,s2))
if (!TOO_SMALL(n) && !ROCKBOX_UNALIGNED(s1,s2))
{
/* Otherwise, load and compare the blocks of memory one
word at a time. */

View File

@ -38,7 +38,7 @@ QUICKREF
#include "_ansi.h" /* for _DEFUN */
/* Nonzero if X is not aligned on a "long" boundary. */
#define UNALIGNED(X) ((long)X & (sizeof (long) - 1))
#define ROCKBOX_UNALIGNED(X) ((long)X & (sizeof (long) - 1))
/* How many bytes are loaded each iteration of the word copy loop. */
#define LBLOCKSIZE (sizeof (long))
@ -83,7 +83,7 @@ _DEFUN (strchr, (s1, i),
unsigned long mask,j;
unsigned long *aligned_addr;
if (!UNALIGNED (s))
if (!ROCKBOX_UNALIGNED (s))
{
mask = 0;
for (j = 0; j < LBLOCKSIZE; j++)

View File

@ -40,7 +40,7 @@ QUICKREF
#include "_ansi.h" /* for _DEFUN */
/* Nonzero if either X or Y is not aligned on a "long" boundary. */
#define UNALIGNED(X, Y) \
#define ROCKBOX_UNALIGNED(X, Y) \
(((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
/* DETECTNULL returns nonzero if (long)X contains a NULL byte. */
@ -76,7 +76,7 @@ _DEFUN (strcmp, (s1, s2),
unsigned long *a2;
/* If s1 or s2 are unaligned, then compare bytes. */
if (!UNALIGNED (s1, s2))
if (!ROCKBOX_UNALIGNED (s1, s2))
{
/* If s1 and s2 are word-aligned, compare them a word at a time. */
a1 = (unsigned long*)s1;

View File

@ -40,7 +40,7 @@ QUICKREF
/*SUPPRESS 530*/
/* Nonzero if either X or Y is not aligned on a "long" boundary. */
#define UNALIGNED(X, Y) \
#define ROCKBOX_UNALIGNED(X, Y) \
(((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
#if LONG_MAX == 2147483647L
@ -77,7 +77,7 @@ _DEFUN (strcpy, (dst0, src0),
_CONST long *aligned_src;
/* If SRC or DEST is unaligned, then copy bytes. */
if (!UNALIGNED (src, dst))
if (!ROCKBOX_UNALIGNED (src, dst))
{
aligned_dst = (long*)dst;
aligned_src = (long*)src;

View File

@ -41,7 +41,7 @@ QUICKREF
#include "_ansi.h" /* for _DEFUN */
/* Nonzero if either X or Y is not aligned on a "long" boundary. */
#define UNALIGNED(X, Y) \
#define ROCKBOX_UNALIGNED(X, Y) \
(((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
/* DETECTNULL returns nonzero if (long)X contains a NULL byte. */
@ -86,7 +86,7 @@ _DEFUN (strncmp, (s1, s2, n),
return 0;
/* If s1 or s2 are unaligned, then compare bytes. */
if (!UNALIGNED (s1, s2))
if (!ROCKBOX_UNALIGNED (s1, s2))
{
/* If s1 and s2 are word-aligned, compare them a word at a time. */
a1 = (unsigned long*)s1;