Home | History | Annotate | Download | only in MagickWand
      1 /*
      2   Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
      3   dedicated to making software imaging solutions freely available.
      4 
      5   You may not use this file except in compliance with the License.  You may
      6   obtain a copy of the License at
      7 
      8     https://imagemagick.org/script/license.php
      9 
     10   Unless required by applicable law or agreed to in writing, software
     11   distributed under the License is distributed on an "AS IS" BASIS,
     12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13   See the License for the specific language governing permissions and
     14   limitations under the License.
     15 
     16   MagickWand method attributes.
     17 */
     18 #ifndef MAGICKWAND_METHOD_ATTRIBUTE_H
     19 #define MAGICKWAND_METHOD_ATTRIBUTE_H
     20 
     21 #if defined(__cplusplus) || defined(c_plusplus)
     22 extern "C" {
     23 #endif
     24 
     25 #if defined(__BORLANDC__) && defined(_DLL)
     26 #  define _MAGICKDLL_
     27 #  define _MAGICKLIB_
     28 #  define MAGICKCORE_MODULES_SUPPORT
     29 #  undef MAGICKCORE_BUILD_MODULES
     30 #endif
     31 
     32 #if defined(MAGICKWAND_WINDOWS_SUPPORT) && !defined(__CYGWIN__)
     33 #  define WandPrivate
     34 #  if defined(_MT) && defined(_DLL) && !defined(_MAGICKDLL_) && !defined(_LIB)
     35 #    define _MAGICKDLL_
     36 #  endif
     37 #  if defined(_MAGICKDLL_)
     38 #    if defined(_VISUALC_)
     39 #      pragma warning( disable: 4273 )  /* Disable the dll linkage warnings */
     40 #    endif
     41 #    if !defined(_MAGICKLIB_)
     42 #      if defined(__clang__) || defined(__GNUC__)
     43 #        define WandExport __attribute__ ((dllimport))
     44 #      else
     45 #        define WandExport __declspec(dllimport)
     46 #      endif
     47 #    else
     48 #      if defined(__clang__) || defined(__GNUC__)
     49 #        define WandExport __attribute__ ((dllexport))
     50 #      else
     51 #        define WandExport __declspec(dllexport)
     52 #      endif
     53 #    endif
     54 #  else
     55 #    define WandExport
     56 #  endif
     57 #  if defined(_VISUALC_)
     58 #    pragma warning(disable : 4018)
     59 #    pragma warning(disable : 4068)
     60 #    pragma warning(disable : 4244)
     61 #    pragma warning(disable : 4142)
     62 #    pragma warning(disable : 4800)
     63 #    pragma warning(disable : 4786)
     64 #    pragma warning(disable : 4996)
     65 #  endif
     66 #else
     67 #  if defined(__clang__) || (__GNUC__ >= 4)
     68 #    define WandExport __attribute__ ((visibility ("default")))
     69 #    define WandPrivate  __attribute__ ((visibility ("hidden")))
     70 #  else
     71 #    define WandExport
     72 #    define WandPrivate
     73 #  endif
     74 #endif
     75 
     76 #define MagickWandSignature  0xabacadabUL
     77 #if !defined(MagickPathExtent)
     78 #  define MagickPathExtent  4096
     79 #endif
     80 
     81 #if defined(MAGICKCORE_HAVE___ATTRIBUTE__)
     82 #  define wand_aligned(x)  __attribute__((aligned(x)))
     83 #  define wand_attribute  __attribute__
     84 #  define wand_unused(x)  wand_unused_ ## x __attribute__((unused))
     85 #  define wand_unreferenced(x)  /* nothing */
     86 #elif defined(MAGICKWAND_WINDOWS_SUPPORT) && !defined(__CYGWIN__)
     87 #  define wand_aligned(x)  __declspec(align(x))
     88 #  define wand_attribute(x)  /* nothing */
     89 #  define wand_unused(x) x
     90 #  define wand_unreferenced(x) (x)
     91 #else
     92 #  define wand_aligned(x)  /* nothing */
     93 #  define wand_attribute(x)  /* nothing */
     94 #  define wand_unused(x) x
     95 #  define wand_unreferenced(x)  /* nothing */
     96 #endif
     97 
     98 #if !defined(__clang__) && (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
     99 #  define wand_alloc_size(x)  __attribute__((__alloc_size__(x)))
    100 #  define wand_alloc_sizes(x,y)  __attribute__((__alloc_size__(x,y)))
    101 #else
    102 #  define wand_alloc_size(x)  /* nothing */
    103 #  define wand_alloc_sizes(x,y)  /* nothing */
    104 #endif
    105 
    106 #if defined(__clang__) || (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
    107 #  define wand_cold_spot  __attribute__((__cold__))
    108 #  define wand_hot_spot  __attribute__((__hot__))
    109 #else
    110 #  define wand_cold_spot
    111 #  define wand_hot_spot
    112 #endif
    113 
    114 #if defined(__cplusplus) || defined(c_plusplus)
    115 }
    116 #endif
    117 
    118 #endif
    119