strlen.c 420 B

123456789101112131415161718192021222324
  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. size_t Wstrlen(const Wchar *s)
  14. {
  15. register const Wchar *p;
  16. for (p=s ; *p ; p++);
  17. return p - s;
  18. }
  19. libc_hidden_weak(Wstrlen)