plvrsion.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "prinit.h"
  6. #include "prvrsion.h"
  7. /************************************************************************/
  8. /**************************IDENTITY AND VERSIONING***********************/
  9. /************************************************************************/
  10. #include "_pl_bld.h"
  11. #if !defined(_BUILD_TIME)
  12. #ifdef HAVE_LONG_LONG
  13. #define _BUILD_TIME 0
  14. #else
  15. #define _BUILD_TIME {0, 0}
  16. #endif
  17. #endif
  18. #if !defined(_BUILD_STRING)
  19. #define _BUILD_STRING ""
  20. #endif
  21. #if !defined(_PRODUCTION)
  22. #define _PRODUCTION ""
  23. #endif
  24. #if defined(DEBUG)
  25. #define _DEBUG_STRING " (debug)"
  26. #else
  27. #define _DEBUG_STRING ""
  28. #endif
  29. /*
  30. * A trick to expand the PR_VMAJOR macro before concatenation.
  31. */
  32. #define CONCAT(x, y) x ## y
  33. #define CONCAT2(x, y) CONCAT(x, y)
  34. #define VERSION_DESC_NAME CONCAT2(prVersionDescription_libprstrms, PR_VMAJOR)
  35. PRVersionDescription VERSION_DESC_NAME =
  36. {
  37. /* version */ 2, /* this is the only one supported */
  38. /* buildTime */ _BUILD_TIME, /* usecs since midnight 1/1/1970 GMT */
  39. /* buildTimeString */ _BUILD_STRING, /* ditto, but human readable */
  40. /* vMajor */ PR_VMAJOR, /* NSPR's version number */
  41. /* vMinor */ PR_VMINOR, /* and minor version */
  42. /* vPatch */ PR_VPATCH, /* and patch */
  43. /* beta */ PR_BETA, /* beta build boolean */
  44. #if defined(DEBUG)
  45. /* debug */ PR_TRUE, /* a debug build */
  46. #else
  47. /* debug */ PR_FALSE, /* an optomized build */
  48. #endif
  49. /* special */ PR_FALSE, /* they're all special, but ... */
  50. /* filename */ _PRODUCTION, /* the produced library name */
  51. /* description */ "Portable runtime", /* what we are */
  52. /* security */ "N/A", /* not applicable here */
  53. /* copywrite */ "This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.",
  54. /* comment */ "http://www.mozilla.org/MPL/",
  55. /* specialString */ ""
  56. };
  57. #ifdef XP_UNIX
  58. /*
  59. * Version information for the 'ident' and 'what commands
  60. *
  61. * NOTE: the first component of the concatenated rcsid string
  62. * must not end in a '$' to prevent rcs keyword substitution.
  63. */
  64. static char rcsid[] = "$Header: NSPR " PR_VERSION _DEBUG_STRING
  65. " " _BUILD_STRING " $";
  66. static char sccsid[] = "@(#)NSPR " PR_VERSION _DEBUG_STRING
  67. " " _BUILD_STRING;
  68. #endif /* XP_UNIX */
  69. #ifdef _PR_HAS_PRAGMA_DIAGNOSTIC
  70. #pragma GCC diagnostic push
  71. #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  72. #endif
  73. PR_IMPLEMENT(const PRVersionDescription*) libVersionPoint()
  74. {
  75. #ifdef XP_UNIX
  76. /*
  77. * Add dummy references to rcsid and sccsid to prevent them
  78. * from being optimized away as unused variables.
  79. */
  80. const char *dummy;
  81. dummy = rcsid;
  82. dummy = sccsid;
  83. #endif
  84. return &VERSION_DESC_NAME;
  85. } /* versionEntryPointType */
  86. #ifdef _PR_HAS_PRAGMA_DIAGNOSTIC
  87. #pragma GCC diagnostic pop
  88. #endif
  89. /* plvrsion.c */