winpr.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /**
  2. * WinPR: Windows Portable Runtime
  3. * Debugging Utils
  4. *
  5. * Copyright 2015 Armin Novak <armin.novak@thincast.com>
  6. * Copyright 2015 Thincast Technologies GmbH
  7. *
  8. * Licensed under the Apache License, Version 2.0 (the "License");
  9. * you may not use this file except in compliance with the License.
  10. * You may obtain a copy of the License at
  11. *
  12. * http://www.apache.org/licenses/LICENSE-2.0
  13. *
  14. * Unless required by applicable law or agreed to in writing, software
  15. * distributed under the License is distributed on an "AS IS" BASIS,
  16. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17. * See the License for the specific language governing permissions and
  18. * limitations under the License.
  19. */
  20. #ifdef HAVE_CONFIG_H
  21. #include "config.h"
  22. #endif
  23. #include "buildflags.h"
  24. #include <stdlib.h>
  25. #include <stdio.h>
  26. #include <winpr/crt.h>
  27. #include <winpr/string.h>
  28. #include <winpr/winpr.h>
  29. #include <winpr/version.h>
  30. #include <winpr/wlog.h>
  31. #if !defined(WIN32)
  32. #include <pthread.h>
  33. #endif
  34. void winpr_get_version(int* major, int* minor, int* revision)
  35. {
  36. if (major)
  37. *major = WINPR_VERSION_MAJOR;
  38. if (minor)
  39. *minor = WINPR_VERSION_MINOR;
  40. if (revision)
  41. *revision = WINPR_VERSION_REVISION;
  42. }
  43. const char* winpr_get_version_string(void)
  44. {
  45. return WINPR_VERSION_FULL;
  46. }
  47. const char* winpr_get_build_date(void)
  48. {
  49. static char build_date[] = __DATE__ " " __TIME__;
  50. return build_date;
  51. }
  52. const char* winpr_get_build_revision(void)
  53. {
  54. return GIT_REVISION;
  55. }
  56. const char* winpr_get_build_config(void)
  57. {
  58. static const char build_config[] =
  59. "Build configuration: " BUILD_CONFIG "\n"
  60. "Build type: " BUILD_TYPE "\n"
  61. "CFLAGS: " CFLAGS "\n"
  62. "Compiler: " COMPILER_ID ", " COMPILER_VERSION "\n"
  63. "Target architecture: " TARGET_ARCH "\n";
  64. return build_config;
  65. }