You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
3.5 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: xtests/internal/safestr.h
  3. *
  4. * Purpose: Handles detection of safe string library.
  5. *
  6. * Created: 9th February 2008
  7. * Updated: 8th March 2008
  8. *
  9. * Author: Matthew Wilson
  10. *
  11. * Home: http://www.xtests.org/
  12. *
  13. * Copyright: Matthew Wilson and Synesis Software Pty Ltd, 2008.
  14. *
  15. * Redistribution and use in source and binary forms, with or without
  16. * modification, are permitted provided that the following conditions are
  17. * met:
  18. *
  19. * - Redistributions of source code must retain the above copyright notice,
  20. * this list of conditions and the following disclaimer.
  21. * - Redistributions in binary form must reproduce the above copyright
  22. * notice, this list of conditions and the following disclaimer in the
  23. * documentation and/or other materials provided with the distribution.
  24. * - Neither the names of Matthew Wilson and Synesis Software nor the names
  25. * of any contributors may be used to endorse or promote products derived
  26. * from this software without specific prior written permission.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  29. * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  30. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  31. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  32. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  33. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  34. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  35. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  36. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  37. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  38. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  39. *
  40. * ////////////////////////////////////////////////////////////////////// */
  41. /** \file xtests/internal/safestr.h
  42. *
  43. * \brief [C, C++] Handles detection of safe string library.
  44. */
  45. #ifndef XTESTS_INCL_XTESTS_INTERNAL_H_SAFESTR
  46. #define XTESTS_INCL_XTESTS_INTERNAL_H_SAFESTR
  47. /* /////////////////////////////////////////////////////////////////////////
  48. * Includes
  49. */
  50. #ifndef XTESTS_INCL_XTESTS_H_XTESTS
  51. # include <xtests/xtests.h>
  52. #endif /* !XTESTS_INCL_XTESTS_H_XTESTS */
  53. #ifdef XTESTS_SAFE_STR_USE_crtdefs_h_
  54. # undef XTESTS_SAFE_STR_USE_crtdefs_h_
  55. #endif /* XTESTS_SAFE_STR_USE_crtdefs_h_ */
  56. #if defined(__BORLANDC__)
  57. #elif defined(__DMC__)
  58. #elif defined(__GNUC__)
  59. #elif defined(__INTEL_COMPILER)
  60. # if defined(_MSC_VER) && \
  61. _MSC_VER >= 1400
  62. # define XTESTS_SAFE_STR_USE_crtdefs_h_
  63. # endif /* _MSC_VER >= 1400 */
  64. #elif defined(__MWERKS__)
  65. #elif defined(__WATCOMC__)
  66. #elif defined(_MSC_VER)
  67. # if _MSC_VER >= 1400
  68. # define XTESTS_SAFE_STR_USE_crtdefs_h_
  69. # endif /* _MSC_VER >= 1400 */
  70. #elif defined(__COMO__)
  71. #else
  72. #endif /* compiler */
  73. #ifdef XTESTS_SAFE_STR_USE_crtdefs_h_
  74. # include <crtdefs.h>
  75. #endif /* XTESTS_SAFE_STR_USE_crtdefs_h_ */
  76. /* /////////////////////////////////////////////////////////////////////////
  77. * Includes
  78. */
  79. #ifdef __STDC_SECURE_LIB__
  80. # if defined(__STDC_WANT_SECURE_LIB__) && \
  81. __STDC_WANT_SECURE_LIB__ == 1
  82. # define XTESTS_USING_SAFE_STR_FUNCTIONS
  83. # endif /* __STDC_WANT_SECURE_LIB__ */
  84. #endif /* __STDC_SECURE_LIB__ */
  85. /* ////////////////////////////////////////////////////////////////////// */
  86. #endif /* XTESTS_INCL_XTESTS_INTERNAL_H_SAFESTR */
  87. /* ////////////////////////////////////////////////////////////////////// */