GNU Radio 3.7.1 C++ API
|
00001 /* 00002 * Copyright 2010 Free Software Foundation, Inc. 00003 * 00004 * This file is part of GNU Radio 00005 * 00006 * GNU Radio is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 3, or (at your option) 00009 * any later version. 00010 * 00011 * GNU Radio is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with GNU Radio; see the file COPYING. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, 00019 * Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef INCLUDED_GNURADIO_ATTRIBUTES_H 00023 #define INCLUDED_GNURADIO_ATTRIBUTES_H 00024 00025 //////////////////////////////////////////////////////////////////////// 00026 // Cross-platform attribute macros 00027 //////////////////////////////////////////////////////////////////////// 00028 #if defined __GNUC__ 00029 # define __GR_ATTR_ALIGNED(x) __attribute__((aligned(x))) 00030 # define __GR_ATTR_UNUSED __attribute__((unused)) 00031 # define __GR_ATTR_INLINE __attribute__((always_inline)) 00032 # define __GR_ATTR_DEPRECATED __attribute__((deprecated)) 00033 # if __GNUC__ >= 4 00034 # define __GR_ATTR_EXPORT __attribute__((visibility("default"))) 00035 # define __GR_ATTR_IMPORT __attribute__((visibility("default"))) 00036 # else 00037 # define __GR_ATTR_EXPORT 00038 # define __GR_ATTR_IMPORT 00039 # endif 00040 #elif _MSC_VER 00041 # define __GR_ATTR_ALIGNED(x) __declspec(align(x)) 00042 # define __GR_ATTR_UNUSED 00043 # define __GR_ATTR_INLINE __forceinline 00044 # define __GR_ATTR_DEPRECATED __declspec(deprecated) 00045 # define __GR_ATTR_EXPORT __declspec(dllexport) 00046 # define __GR_ATTR_IMPORT __declspec(dllimport) 00047 #else 00048 # define __GR_ATTR_ALIGNED(x) 00049 # define __GR_ATTR_UNUSED 00050 # define __GR_ATTR_INLINE 00051 # define __GR_ATTR_DEPRECATED 00052 # define __GR_ATTR_EXPORT 00053 # define __GR_ATTR_IMPORT 00054 #endif 00055 00056 //////////////////////////////////////////////////////////////////////// 00057 // define inline when building C 00058 //////////////////////////////////////////////////////////////////////// 00059 #if defined(_MSC_VER) && !defined(__cplusplus) && !defined(inline) 00060 # define inline __inline 00061 #endif 00062 00063 //////////////////////////////////////////////////////////////////////// 00064 // suppress warnings 00065 //////////////////////////////////////////////////////////////////////// 00066 #ifdef _MSC_VER 00067 # pragma warning(disable: 4251) // class 'A<T>' needs to have dll-interface to be used by clients of class 'B' 00068 # pragma warning(disable: 4275) // non dll-interface class ... used as base for dll-interface class ... 00069 # pragma warning(disable: 4244) // conversion from 'double' to 'float', possible loss of data 00070 # pragma warning(disable: 4305) // 'initializing' : truncation from 'double' to 'float' 00071 # pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow) 00072 #endif 00073 00074 #endif /* INCLUDED_GNURADIO_ATTRIBUTES_H */