fastcdr_dll.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #ifndef _FASTCDR_FASTCDR_DLL_H_
  15. #define _FASTCDR_FASTCDR_DLL_H_
  16. #include <fastcdr/config.h>
  17. // normalize macros
  18. #if !defined(FASTCDR_DYN_LINK) && !defined(FASTCDR_STATIC_LINK) \
  19. && !defined(EPROSIMA_ALL_DYN_LINK) && !defined(EPROSIMA_ALL_STATIC_LINK)
  20. #define FASTCDR_STATIC_LINK
  21. #endif
  22. #if defined(EPROSIMA_ALL_DYN_LINK) && !defined(FASTCDR_DYN_LINK)
  23. #define FASTCDR_DYN_LINK
  24. #endif
  25. #if defined(FASTCDR_DYN_LINK) && defined(FASTCDR_STATIC_LINK)
  26. #error Must not define both FASTCDR_DYN_LINK and FASTCDR_STATIC_LINK
  27. #endif
  28. #if defined(EPROSIMA_ALL_NO_LIB) && !defined(FASTCDR_NO_LIB)
  29. #define FASTCDR_NO_LIB
  30. #endif
  31. // enable dynamic linking
  32. #if defined(_WIN32)
  33. #if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTCDR_DYN_LINK)
  34. #if defined(fastcdr_EXPORTS)
  35. #define Cdr_DllAPI __declspec( dllexport )
  36. #else
  37. #define Cdr_DllAPI __declspec( dllimport )
  38. #endif // FASTCDR_SOURCE
  39. #else
  40. #define Cdr_DllAPI
  41. #endif
  42. #else
  43. #define Cdr_DllAPI
  44. #endif // _WIN32
  45. // Auto linking.
  46. #if !defined(FASTCDR_SOURCE) && !defined(EPROSIMA_ALL_NO_LIB) \
  47. && !defined(FASTCDR_NO_LIB)
  48. // Set properties.
  49. #define EPROSIMA_LIB_NAME fastcdr
  50. #if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTCDR_DYN_LINK)
  51. #define EPROSIMA_DYN_LINK
  52. #endif
  53. #include "eProsima_auto_link.h"
  54. #endif // auto-linking disabled
  55. #endif // _FASTCDR_FASTCDR_DLL_H_