strlen.c 448 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright (C) 2002 Manuel Novoa III
  3. * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
  4. *
  5. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. */
  7. #include "_string.h"
  8. #ifdef WANT_WIDE
  9. # define Wstrlen wcslen
  10. #else
  11. # define Wstrlen strlen
  12. #endif
  13. libc_hidden_proto(Wstrlen)
  14. size_t Wstrlen(const Wchar *s)
  15. {
  16. register const Wchar *p;
  17. for (p=s ; *p ; p++);
  18. return p - s;
  19. }
  20. libc_hidden_weak(Wstrlen)