/************************************************************************** * * * Basic macros header file * * * * Programmed by Ondrej Jombik * * Copyright (c) 1996-2000 Condy software inc. * * Copyright (c) 2001-2003 Platon Software Development Group * * All rights reserved. * * * * Updates: 16.4.2000, 5.10.2001 * * 14.3.2002 - copyrights updates * * - swap() macro improvements * * * **************************************************************************/ /** * Basic C preprocessor macros * * @file platon/macros.h * @author Ondrej Jombik * @version \$Platon: libplaton/platon/macros.h,v 1.11 2003/04/23 19:28:35 nepto Exp $ * @date 2000-2003 */ /** * @mainpage * @htmlinclude mainpage.html */ #ifndef _PLATON_MACROS_H #define _PLATON_MACROS_H /** Returns lower from two numbers */ #ifndef max #define max(a, b) (((a) > (b)) ? (a) : (b)) #endif /** Returns higher from two numbers */ #ifndef min #define min(a, b) (((a) < (b)) ? (a) : (b)) #endif /** Swap two numbers without using temporary variable */ #ifndef swap #define swap(a, b) \ do { \ (a) += (b); \ (b) = (a) - (b); \ (a) -= (b); \ } while (0) #endif #endif /* #ifndef _PLATON_MACROS_H */