mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 20:39:33 +08:00
24 lines
787 B
C
24 lines
787 B
C
|
/* Copyright (c) 2017 SiFive Inc. All rights reserved.
|
||
|
|
||
|
This copyrighted material is made available to anyone wishing to use,
|
||
|
modify, copy, or redistribute it subject to the terms and conditions
|
||
|
of the BSD License. This program is distributed in the hope that
|
||
|
it will be useful, but WITHOUT ANY WARRANTY expressed or implied,
|
||
|
including the implied warranties of MERCHANTABILITY or FITNESS FOR
|
||
|
A PARTICULAR PURPOSE. A copy of this license is available at
|
||
|
http://www.opensource.org/licenses.
|
||
|
*/
|
||
|
|
||
|
#ifndef _SYS_STRING_H
|
||
|
#define _SYS_STRING_H
|
||
|
|
||
|
static __inline unsigned long __libc_detect_null(unsigned long w)
|
||
|
{
|
||
|
unsigned long mask = 0x7f7f7f7f;
|
||
|
if (sizeof (long) == 8)
|
||
|
mask = ((mask << 16) << 16) | mask;
|
||
|
return ~(((w & mask) + mask) | w | mask);
|
||
|
}
|
||
|
|
||
|
#endif
|