summaryrefslogtreecommitdiff
path: root/tools/cpio/src/blank.h
blob: 1ab3d57b816408194a1ba98a0b55d370026e3c07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * isblank() and iswblank() are not available with many pre-XSH6
 * systems. Check whether isblank was defined, and assume it is
 * not available if not.
 */
/*	Sccsid @(#)blank.h	1.3 (gritter) 5/1/04	*/

#ifndef	__dietlibc__
#ifndef	LIBCOMMON_BLANK_H
#define	LIBCOMMON_BLANK_H	1

#include <ctype.h>
#include <wctype.h>

#ifndef	isblank

static
#ifdef	__GNUC__
__inline__
#endif	/* __GNUC__ */
int
my_isblank(int c)
{
	return c == ' ' || c == '\t';
}
#define	isblank(c)	my_isblank(c)

static int
my_iswblank(wint_t c)
{
	return c == L' ' || c == L'\t';
}
#undef	iswblank
#define	iswblank(c)	my_iswblank(c)

#endif	/* !isblank */
#endif	/* !LIBCOMMON_BLANK_H */
#endif	/* !__dietlibc__ */