jack2 codebase
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.

129 lines
4.4KB

  1. /*
  2. Copyright (C) 2004-2012 Grame
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as published by
  5. the Free Software Foundation; either version 2.1 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  14. */
  15. #ifndef __jack_systemdeps_h__
  16. #define __jack_systemdeps_h__
  17. #ifndef POST_PACKED_STRUCTURE
  18. #ifdef __GNUC__
  19. /* POST_PACKED_STRUCTURE needs to be a macro which
  20. expands into a compiler directive. The directive must
  21. tell the compiler to arrange the preceding structure
  22. declaration so that it is packed on byte-boundaries rather
  23. than use the natural alignment of the processor and/or
  24. compiler.
  25. */
  26. #define PRE_PACKED_STRUCTURE
  27. #define POST_PACKED_STRUCTURE __attribute__((__packed__))
  28. #else
  29. #ifdef _MSC_VER
  30. #define PRE_PACKED_STRUCTURE1 __pragma(pack(push,1))
  31. #define PRE_PACKED_STRUCTURE PRE_PACKED_STRUCTURE1
  32. /* PRE_PACKED_STRUCTURE needs to be a macro which
  33. expands into a compiler directive. The directive must
  34. tell the compiler to arrange the following structure
  35. declaration so that it is packed on byte-boundaries rather
  36. than use the natural alignment of the processor and/or
  37. compiler.
  38. */
  39. #define POST_PACKED_STRUCTURE ;__pragma(pack(pop))
  40. /* and POST_PACKED_STRUCTURE needs to be a macro which
  41. restores the packing to its previous setting */
  42. #else
  43. #define PRE_PACKED_STRUCTURE
  44. #define POST_PACKED_STRUCTURE
  45. #endif /* _MSC_VER */
  46. #endif /* __GNUC__ */
  47. #endif
  48. #if defined(WIN32) && !defined(__CYGWIN__) && !defined(GNU_WIN32)
  49. #include <windows.h>
  50. #ifdef _MSC_VER /* Microsoft compiler */
  51. #define __inline__ inline
  52. #if (!defined(int8_t) && !defined(_STDINT_H))
  53. #define __int8_t_defined
  54. typedef char int8_t;
  55. typedef unsigned char uint8_t;
  56. typedef short int16_t;
  57. typedef unsigned short uint16_t;
  58. typedef long int32_t;
  59. typedef unsigned long uint32_t;
  60. typedef LONGLONG int64_t;
  61. typedef ULONGLONG uint64_t;
  62. #endif
  63. #elif __MINGW32__ /* MINGW */
  64. #include <stdint.h>
  65. #include <sys/types.h>
  66. #else /* other compilers ...*/
  67. #include <inttypes.h>
  68. #include <pthread.h>
  69. #include <sys/types.h>
  70. #endif
  71. #if !defined(_PTHREAD_H) && !defined(PTHREAD_WIN32)
  72. /**
  73. * to make jack API independent of different thread implementations,
  74. * we define jack_native_thread_t to HANDLE here.
  75. */
  76. typedef HANDLE jack_native_thread_t;
  77. #else
  78. #ifdef PTHREAD_WIN32 // Added by JE - 10-10-2011
  79. #include <ptw32/pthread.h> // Makes sure we #include the ptw32 version !
  80. #endif
  81. /**
  82. * to make jack API independent of different thread implementations,
  83. * we define jack_native_thread_t to pthread_t here.
  84. */
  85. typedef pthread_t jack_native_thread_t;
  86. #endif
  87. #endif /* WIN32 && !__CYGWIN__ && !GNU_WIN32 */
  88. #if defined(__APPLE__) || defined(__linux__) || defined(__sun__) || defined(sun) || defined(__unix__) || defined(__CYGWIN__) || defined(GNU_WIN32)
  89. #if defined(__CYGWIN__) || defined(GNU_WIN32)
  90. #include <stdint.h>
  91. #endif
  92. #include <inttypes.h>
  93. #include <pthread.h>
  94. #include <sys/types.h>
  95. /**
  96. * to make jack API independent of different thread implementations,
  97. * we define jack_native_thread_t to pthread_t here.
  98. */
  99. typedef pthread_t jack_native_thread_t;
  100. #endif /* __APPLE__ || __linux__ || __sun__ || sun */
  101. #if defined(__arm__)
  102. #undef POST_PACKED_STRUCTURE
  103. #define POST_PACKED_STRUCTURE
  104. #endif /* __arm__ */
  105. #endif /* __jack_systemdeps_h__ */