PageRenderTime 36ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llcommon/ctype_workaround.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 54 lines | 13 code | 7 blank | 34 comment | 0 complexity | bfb13c1583d8a90539bd68cd838487e2 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file ctype_workaround.h
  3. * @brief The workaround is to create some legacy symbols that point
  4. * to the correct symbols, which avoids link errors.
  5. *
  6. * $LicenseInfo:firstyear=2006&license=viewerlgpl$
  7. * Second Life Viewer Source Code
  8. * Copyright (C) 2010, Linden Research, Inc.
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation;
  13. * version 2.1 of the License only.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with this library; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. *
  24. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  25. * $/LicenseInfo$
  26. */
  27. #ifndef _CTYPE_WORKAROUND_H_
  28. #define _CTYPE_WORKAROUND_H_
  29. /**
  30. * the CTYPE_WORKAROUND is needed for linux dev stations that don't
  31. * have the broken libc6 packages needed by our out-of-date static
  32. * libs (such as libcrypto and libcurl).
  33. *
  34. * -- Leviathan 20060113
  35. */
  36. #include <cctype>
  37. __const unsigned short int *__ctype_b;
  38. __const __int32_t *__ctype_tolower;
  39. __const __int32_t *__ctype_toupper;
  40. // call this function at the beginning of main()
  41. void ctype_workaround()
  42. {
  43. __ctype_b = *(__ctype_b_loc());
  44. __ctype_toupper = *(__ctype_toupper_loc());
  45. __ctype_tolower = *(__ctype_tolower_loc());
  46. }
  47. #endif