source: trunk/yat/utility/deprecate.h @ 1500

Last change on this file since 1500 was 1500, checked in by Peter, 13 years ago

Added structure to deprecate functions. I chose to use a gcc style,
and it is tested in configure whether the compiler supports it. If not
the deprecation has no effect. Using a deprecated function will cause
a compiler warning. In gcc the warning can be turned off with
'-Wno-deprecated'. Possibly we should turn off the warning by default,
so a user has to turn it on by defining
-DYAT_DISABLE_DEPRECATED...

fixes #367

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1#ifndef _theplu_yat_utility_deprecated_
2#define _theplu_yat_utility_deprecated_
3
4// $Id: deprecate.h 1500 2008-09-15 18:47:37Z peter $
5
6/*
7  Copyright (C) 2008 Peter Johansson
8
9  This file is part of the yat library, http://trac.thep.lu.se/yat
10
11  The yat library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License as
13  published by the Free Software Foundation; either version 3 of the
14  License, or (at your option) any later version.
15
16  The yat library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20
21  You should have received a copy of the GNU General Public License
22  along with yat. If not, see <http://www.gnu.org/licenses/>.
23*/
24
25///
26/// \file utility/deprecate.h
27///
28
29#include "config_public.h"
30
31#ifdef YAT_HAVE_GCC_DEPRECATED
32/// if supported by compiler define attribute deprecated
33#define YAT_DEPRECATE __attribute__((deprecated))
34#else
35/// otherwise define it as empty
36#define YAT_DEPRECATE
37#endif
38
39#endif
Note: See TracBrowser for help on using the repository browser.