Collection of tools useful for audio production
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.

78 lines
2.3KB

  1. /*
  2. * JackBridge common defines
  3. * Copyright (C) 2013 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any purpose with
  6. * or without fee is hereby granted, provided that the above copyright notice and this
  7. * permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
  10. * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
  11. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  12. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  13. * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef JACKBRIDGE_DEFINES_HPP_INCLUDED
  17. #define JACKBRIDGE_DEFINES_HPP_INCLUDED
  18. // Check OS
  19. #if defined(WIN64) || defined(_WIN64) || defined(__WIN64__)
  20. # define JACKBRIDGE_OS_WIN64
  21. #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
  22. # define JACKBRIDGE_OS_WIN32
  23. #elif defined(__APPLE__)
  24. # define JACKBRIDGE_OS_MAC
  25. #elif defined(__HAIKU__)
  26. # define JACKBRIDGE_OS_HAIKU
  27. #elif defined(__linux__) || defined(__linux)
  28. # define JACKBRIDGE_OS_LINUX
  29. #else
  30. # warning Unsupported platform!
  31. #endif
  32. #if defined(JACKBRIDGE_OS_WIN32) || defined(JACKBRIDGE_OS_WIN64)
  33. # define JACKBRIDGE_OS_WIN
  34. #elif ! defined(JACKBRIDGE_OS_HAIKU)
  35. # define JACKBRIDGE_OS_UNIX
  36. #endif
  37. // Check for C++11 support
  38. #if defined(HAVE_CPP11_SUPPORT)
  39. # define JACKBRIDGE_PROPER_CPP11_SUPPORT
  40. #elif defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__)
  41. # if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405
  42. # define JACKBRIDGE_PROPER_CPP11_SUPPORT
  43. # if (__GNUC__ * 100 + __GNUC_MINOR__) < 407
  44. # define override // gcc4.7+ only
  45. # endif
  46. # endif
  47. #endif
  48. #ifndef JACKBRIDGE_PROPER_CPP11_SUPPORT
  49. # define override
  50. # define noexcept
  51. # define nullptr (0)
  52. #endif
  53. // Common includes
  54. #ifdef JACKBRIDGE_OS_WIN
  55. # include <winsock2.h>
  56. # include <windows.h>
  57. #else
  58. # include <unistd.h>
  59. # ifndef __cdecl
  60. # define __cdecl
  61. # endif
  62. #endif
  63. // Define JACKBRIDGE_EXPORT
  64. #if defined(JACKBRIDGE_OS_WIN) && ! defined(__WINE__)
  65. # define JACKBRIDGE_EXPORT extern "C" __declspec (dllexport)
  66. #else
  67. # define JACKBRIDGE_EXPORT extern "C" __attribute__ ((visibility("default")))
  68. #endif
  69. #endif // JACKBRIDGE_DEFINES_HPP_INCLUDED