hal_base.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * hal_base.h
  3. *
  4. * Copyright 2013-2021 Michael Zillgith
  5. *
  6. * This file is part of Platform Abstraction Layer (libpal)
  7. * for libiec61850, libmms, and lib60870.
  8. */
  9. #ifndef HAL_INC_HAL_BASE_H_
  10. #define HAL_INC_HAL_BASE_H_
  11. #include <stdlib.h>
  12. #include <stdarg.h>
  13. #include <stdint.h>
  14. #include <stdbool.h>
  15. #include <string.h>
  16. #ifdef __GNUC__
  17. #define ATTRIBUTE_PACKED __attribute__ ((__packed__))
  18. #else
  19. #define ATTRIBUTE_PACKED
  20. #endif
  21. #ifndef DEPRECATED
  22. #if defined(__GNUC__) || defined(__clang__)
  23. #define DEPRECATED __attribute__((deprecated))
  24. #else
  25. #define DEPRECATED
  26. #endif
  27. #endif
  28. #if defined _WIN32 || defined __CYGWIN__
  29. #ifdef EXPORT_FUNCTIONS_FOR_DLL
  30. #define PAL_API __declspec(dllexport)
  31. #else
  32. #define PAL_API
  33. #endif
  34. #define PAL_INTERNAL
  35. #else
  36. #if __GNUC__ >= 4
  37. #define PAL_API __attribute__ ((visibility ("default")))
  38. #define PAL_INTERNAL __attribute__ ((visibility ("hidden")))
  39. #else
  40. #define PAL_API
  41. #define PAL_INTERNAL
  42. #endif
  43. #endif
  44. #endif /* HAL_INC_HAL_BASE_H_ */