LinuxStrings.cpp 920 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (c) 2014, Oculus VR, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. *
  9. */
  10. #if (defined(__GNUC__) || defined(__ARMCC_VERSION) || defined(__GCCXML__) || defined(__S3E__) ) && !defined(_WIN32)
  11. #include <string.h>
  12. #ifndef _stricmp
  13. int _stricmp(const char* s1, const char* s2)
  14. {
  15. return strcasecmp(s1,s2);
  16. }
  17. #endif
  18. int _strnicmp(const char* s1, const char* s2, size_t n)
  19. {
  20. return strncasecmp(s1,s2,n);
  21. }
  22. #ifndef _vsnprintf
  23. #define _vsnprintf vsnprintf
  24. #endif
  25. #ifndef __APPLE__
  26. char *_strlwr(char * str )
  27. {
  28. if (str==0)
  29. return 0;
  30. for (int i=0; str[i]; i++)
  31. {
  32. if (str[i]>='A' && str[i]<='Z')
  33. str[i]+='a'-'A';
  34. }
  35. return str;
  36. }
  37. #endif
  38. #endif
粤ICP备19079148号