1 /* @(#)wcscmp.c	1.6 09/06/07 Copyright 1985,2009 J. Schilling */
2 /*
3  *	Copyright (c) 1985,2009 J. Schilling
4  */
5 /*
6  * The contents of this file are subject to the terms of the
7  * Common Development and Distribution License, Version 1.0 only
8  * (the "License").  You may not use this file except in compliance
9  * with the License.
10  *
11  * See the file CDDL.Schily.txt in this distribution for details.
12  * A copy of the CDDL is also available via the Internet at
13  * http://www.opensource.org/licenses/cddl1.txt
14  *
15  * When distributing Covered Code, include this CDDL HEADER in each
16  * file and include the License file CDDL.Schily.txt from this distribution.
17  */
18 
19 #include <schily/standard.h>
20 #include <schily/wchar.h>
21 #include <schily/schily.h>
22 
23 #ifndef	HAVE_WCSCMP
24 
25 EXPORT int
wcscmp(s1,s2)26 wcscmp(s1, s2)
27 	register const wchar_t	*s1;
28 	register const wchar_t	*s2;
29 {
30 	if (s1 == s2)
31 		return (0);
32 
33 	while (*s1 == *s2++) {
34 		if (*s1++ == '\0')
35 			return (0);
36 	}
37 	return (*s1 - *(--s2));
38 }
39 
40 #endif
41