summaryrefslogblamecommitdiff
path: root/src/compat/attr.hpp
blob: 5322a14f5611b5b1c1bb5a9868b08c4e2d1d7cff (plain) (tree)
1
            

















                                                                           
 
                  

 

              




                                           





                                                                         
                   
#pragma once
//    attr.hpp - Attributes.
//
//    Copyright © 2013 Ben Longbons <b.r.longbons@gmail.com>
//
//    This file is part of The Mana World (Athena server)
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.

#include "fwd.hpp"


namespace tmwa
{
#ifdef __clang__
# define FALLTHROUGH [[clang::fallthrough]]
#else
# define FALLTHROUGH /* fallthrough */
#endif

#define JOIN(a, b) a##b

#define WITH_VAR(ty, var, expr)                                 \
    for (bool JOIN(var, _guard) = true; JOIN(var, _guard); )    \
        for (ty var = expr; JOIN(var, _guard); JOIN(var, _guard) = false)
} // namespace tmwa