magick-config.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. /*
  2. Copyright 1999 ImageMagick Studio LLC, a non-profit organization
  3. dedicated to making software imaging solutions freely available.
  4. You may not use this file except in compliance with the License. You may
  5. obtain a copy of the License at
  6. https://imagemagick.org/script/license.php
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. MagickConfig not autogenerated (fixed stuff)
  13. */
  14. #ifndef MAGICKCORE_MAGICK_CONFIG_H
  15. #define MAGICKCORE_MAGICK_CONFIG_H
  16. #include "magick/magick-baseconfig.h"
  17. #if defined(__cplusplus) || defined(c_plusplus)
  18. extern "C" {
  19. #endif
  20. /* Compatibility block */
  21. #if !defined(MAGICKCORE_QUANTUM_DEPTH) && defined(MAGICKCORE_QUANTUM_DEPTH_OBSOLETE_IN_H)
  22. # warning "you should set MAGICKCORE_QUANTUM_DEPTH to sensible default set it to configure time default"
  23. # warning "this is an obsolete behavior please fix your makefile"
  24. # define MAGICKCORE_QUANTUM_DEPTH MAGICKCORE_QUANTUM_DEPTH_OBSOLETE_IN_H
  25. #endif
  26. /* Number of bits in a pixel Quantum (8/16/32/64) */
  27. #ifndef MAGICKCORE_QUANTUM_DEPTH
  28. # error "you should set MAGICKCORE_QUANTUM_DEPTH"
  29. #endif
  30. /* check values */
  31. #if MAGICKCORE_QUANTUM_DEPTH != 8
  32. # if MAGICKCORE_QUANTUM_DEPTH != 16
  33. # if MAGICKCORE_QUANTUM_DEPTH != 32
  34. # if MAGICKCORE_QUANTUM_DEPTH != 64
  35. # error "MAGICKCORE_QUANTUM_DEPTH is not 8/16/32/64 bits"
  36. # endif
  37. # endif
  38. # endif
  39. #endif
  40. #if !defined(MAGICKCORE_HDRI_ENABLE) && defined(MAGICKCORE_HDRI_ENABLE_OBSOLETE_IN_H)
  41. # warning "you should set MAGICKCORE_HDRI_ENABLE to sensible default set it to configure time default"
  42. # warning "this is an obsolete behavior please fix yours makefile"
  43. # define MAGICKCORE_HDRI_ENABLE MAGICKCORE_HDRI_ENABLE_OBSOLETE_IN_H
  44. #endif
  45. /* whether HDRI is enable */
  46. #if !defined(MAGICKCORE_HDRI_ENABLE)
  47. # error "you should set MAGICKCORE_HDRI_ENABLE"
  48. #endif
  49. #if MAGICKCORE_HDRI_ENABLE
  50. # define MAGICKCORE_HDRI_SUPPORT 1
  51. #endif
  52. #if defined __CYGWIN32__ && !defined __CYGWIN__
  53. /* For backwards compatibility with Cygwin b19 and
  54. earlier, we define __CYGWIN__ here, so that
  55. we can rely on checking just for that macro. */
  56. # define __CYGWIN__ __CYGWIN32__
  57. #endif
  58. /*! stringify */
  59. #define MAGICKCORE_STRING_QUOTE(str) #str
  60. #define MAGICKCORE_STRING_XQUOTE(str) MAGICKCORE_STRING_QUOTE(str)
  61. /* ABI SUFFIX */
  62. #ifndef MAGICKCORE_HDRI_SUPPORT
  63. #define MAGICKCORE_ABI_SUFFIX "Q" MAGICKCORE_STRING_XQUOTE(MAGICKCORE_QUANTUM_DEPTH)
  64. #else
  65. #define MAGICKCORE_ABI_SUFFIX "Q" MAGICKCORE_STRING_XQUOTE(MAGICKCORE_QUANTUM_DEPTH) "HDRI"
  66. #endif
  67. /* some path game */
  68. #if !defined __CYGWIN__
  69. # if defined (_WIN32) || defined (_WIN64) || defined (__MSDOS__) || defined (__DJGPP__) || defined (__OS2__)
  70. /* Use Windows separators on all _WIN32 defining
  71. environments, except Cygwin. */
  72. # define MAGICKCORE_DIR_SEPARATOR_CHAR '\\'
  73. # define MAGICKCORE_DIR_SEPARATOR "\\"
  74. # define MAGICKCORE_PATH_SEPARATOR_CHAR ';'
  75. # define MAGICKCORE_PATH_SEPARATOR ";"
  76. # endif
  77. #endif
  78. /* posix */
  79. #ifndef MAGICKCORE_DIR_SEPARATOR_CHAR
  80. /* Assume that not having this is an indicator that all
  81. are missing. */
  82. # define MAGICKCORE_DIR_SEPARATOR_CHAR '/'
  83. # define MAGICKCORE_DIR_SEPARATOR "/"
  84. # define MAGICKCORE_PATH_SEPARATOR_CHAR ':'
  85. # define MAGICKCORE_PATH_SEPARATOR ":"
  86. #endif /* !DIR_SEPARATOR_CHAR */
  87. # if defined(MAGICKCORE_POSIX_SUPPORT) || defined(__MINGW32__)
  88. /* module dir */
  89. #ifndef MAGICKCORE_MODULES_DIRNAME
  90. # define MAGICKCORE_MODULES_DIRNAME MAGICKCORE_MODULES_BASEDIRNAME "-" MAGICKCORE_ABI_SUFFIX
  91. #endif
  92. #ifndef MAGICKCORE_MODULES_PATH
  93. # define MAGICKCORE_MODULES_PATH MAGICKCORE_LIBRARY_ABSOLUTE_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_MODULES_DIRNAME
  94. #endif
  95. #ifndef MAGICKCORE_MODULES_RELATIVE_PATH
  96. #define MAGICKCORE_MODULES_RELATIVE_PATH MAGICKCORE_LIBRARY_RELATIVE_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_MODULES_DIRNAME
  97. #endif
  98. /* Subdirectory under lib to place ImageMagick coder module files */
  99. #ifndef MAGICKCORE_CODER_PATH
  100. # if defined(vms)
  101. # define MAGICKCORE_CODER_PATH "sys$login:"
  102. # else
  103. # define MAGICKCORE_CODER_PATH MAGICKCORE_MODULES_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_CODER_DIRNAME
  104. # endif
  105. #endif
  106. #ifndef MAGICKCORE_CODER_RELATIVE_PATH
  107. # define MAGICKCORE_CODER_RELATIVE_PATH MAGICKCORE_MODULES_RELATIVE_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_CODER_DIRNAME
  108. #endif
  109. /* subdirectory under lib to place ImageMagick filter module files */
  110. #ifndef MAGICKCORE_FILTER_PATH
  111. # if defined(vms)
  112. # define MAGICKCORE_FILTER_PATH "sys$login:"
  113. # else
  114. # define MAGICKCORE_FILTER_PATH MAGICKCORE_MODULES_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_FILTER_DIRNAME
  115. # endif
  116. #endif
  117. #ifndef MAGICKCORE_FILTER_RELATIVE_PATH
  118. # define MAGICKCORE_FILTER_RELATIVE_PATH MAGICKCORE_MODULES_RELATIVE_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_FILTER_DIRNAME
  119. #endif
  120. /* sharearch dir */
  121. #ifndef MAGICKCORE_SHAREARCH_DIRNAME
  122. # define MAGICKCORE_SHAREARCH_DIRNAME MAGICKCORE_SHAREARCH_BASEDIRNAME "-" MAGICKCORE_ABI_SUFFIX
  123. #endif
  124. #ifndef MAGICKCORE_SHAREARCH_PATH
  125. # define MAGICKCORE_SHAREARCH_PATH MAGICKCORE_LIBRARY_ABSOLUTE_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_SHAREARCH_DIRNAME MAGICKCORE_DIR_SEPARATOR
  126. #endif
  127. #ifndef MAGICKCORE_SHAREARCH_RELATIVE_PATH
  128. #define MAGICKCORE_SHAREARCH_RELATIVE_PATH MAGICKCORE_LIBRARY_RELATIVE_PATH MAGICKCORE_DIR_SEPARATOR MAGICKCORE_SHAREARCH_DIRNAME
  129. #endif
  130. /* for Clang compatibility */
  131. #ifndef __has_builtin
  132. # define __has_builtin(x) 0
  133. #endif
  134. #if defined(__GNUC__) && !defined(__clang__)
  135. # define MAGICKCORE_DIAGNOSTIC_PUSH() \
  136. _Pragma("GCC diagnostic push")
  137. # define MAGICKCORE_DIAGNOSTIC_IGNORE_MAYBE_UNINITIALIZED() \
  138. _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
  139. # define MAGICKCORE_DIAGNOSTIC_POP() \
  140. _Pragma("GCC diagnostic pop")
  141. #else
  142. # define MAGICKCORE_DIAGNOSTIC_PUSH()
  143. # define MAGICKCORE_DIAGNOSTIC_IGNORE_MAYBE_UNINITIALIZED()
  144. # define MAGICKCORE_DIAGNOSTIC_POP()
  145. #endif
  146. #define MAGICKCORE_BITS_BELOW(power_of_2) \
  147. ((power_of_2)-1)
  148. #define MAGICKCORE_MAX_ALIGNMENT_PADDING(power_of_2) \
  149. MAGICKCORE_BITS_BELOW(power_of_2)
  150. #define MAGICKCORE_IS_NOT_ALIGNED(n, power_of_2) \
  151. ((n) & MAGICKCORE_BITS_BELOW(power_of_2))
  152. #define MAGICKCORE_IS_NOT_POWER_OF_2(n) \
  153. MAGICKCORE_IS_NOT_ALIGNED((n), (n))
  154. #define MAGICKCORE_ALIGN_DOWN(n, power_of_2) \
  155. ((n) & ~MAGICKCORE_BITS_BELOW(power_of_2))
  156. #define MAGICKCORE_ALIGN_UP(n, power_of_2) \
  157. MAGICKCORE_ALIGN_DOWN((n) + MAGICKCORE_MAX_ALIGNMENT_PADDING(power_of_2),power_of_2)
  158. #endif
  159. #if defined(__cplusplus) || defined(c_plusplus)
  160. }
  161. #endif
  162. #endif