Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-05-05 01:02:15 +0400
committerChristopher Faylor <me@cgf.cx>2001-05-05 01:02:15 +0400
commit63b61cd19ff1ae741a8c3403c1c3fa12bea1c893 (patch)
treec6ca5e70cf2fce1f7793c55d141a732fc0e2d15f /winsup/cygwin/string.h
parent17743fbc49ebb23300e0a36d8c5a27ed63e2bf41 (diff)
Revert much of previous erroneous checkin. Add ChangeLog entry.
* pinfo.h: Correctly set __SIGOFFSET. * path.cc (hash_path_name): Avoid calling library functions for simple copying of characters. * shortcut.c: Use WIN32_LEAN_AND_MEAN. * smallprint.c: Ditto. * environ.cc (getwinenv): Minor clarity fix. * localtime.c: No need to include windows.h * string.h: New file.
Diffstat (limited to 'winsup/cygwin/string.h')
-rw-r--r--winsup/cygwin/string.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/winsup/cygwin/string.h b/winsup/cygwin/string.h
new file mode 100644
index 000000000..20bf6fdba
--- /dev/null
+++ b/winsup/cygwin/string.h
@@ -0,0 +1,44 @@
+/* string.h: Extra string defs
+
+ Copyright 2001 Red Hat, Inc.
+
+This file is part of Cygwin.
+
+This software is a copyrighted work licensed under the terms of the
+Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+details. */
+
+#ifndef _CYGWIN_STRING_H
+#define _CYGWIN_STRING_H
+
+#include_next <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#undef strchr
+#define strchr cygwin_strchr
+extern inline __stdcall char *
+strchr (const char *s, int c)
+{
+ register char * res;
+ __asm__ __volatile__ ("
+ movb %%al,%%ah\n\
+ 1: movb (%1),%%al\n\
+ cmpb %%ah,%%al\n\
+ je 2f\n\
+ incl %1\n\
+ testb %%al,%%al\n\
+ jne 1b\n\
+ xorl %1,%1\n\
+ 2: movl %1,%0\n\
+ ":"=a" (__res), "=r" (s)
+ :"0" (c), "1" (s));
+ return res;
+}
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _CYGWIN_STRING_H */