Rozdiely pre libplaton/platon/macros.h medzi verziami 1.7 a 1.8
| verzia 1.7, 2002/09/19 15:16:00 |
verzia 1.8, 2002/09/26 20:54:21 |
|
|
| * * |
* * |
| **************************************************************************/ |
**************************************************************************/ |
| |
|
| /* $Id$ */ |
/** |
| |
* Basic C preprocessor macros |
| |
* |
| |
* @file platon/macros.h |
| |
* @author Ondrej Jombik <nepto@pobox.sk> |
| |
* @version \$Id$ |
| |
* @date 2000-2002 |
| |
*/ |
| |
|
| |
/** |
| |
* @mainpage |
| |
* This is libplaton library. |
| |
* |
| |
* libplaton is a C/C++ reusable code repository for members of |
| |
* Platon software development group, http://www.platon.sk/ |
| |
*/ |
| |
|
| #ifndef _PLATON_MACROS_H |
#ifndef _PLATON_MACROS_H |
| #define _PLATON_MACROS_H |
#define _PLATON_MACROS_H |
| |
|
| |
/** Returns lower from two numbers */ |
| #ifndef max |
#ifndef max |
| #define max(a, b) (((a) > (b)) ? (a) : (b)) |
#define max(a, b) (((a) > (b)) ? (a) : (b)) |
| #endif |
#endif |
| |
|
| |
/** Returns higher from two numbers */ |
| #ifndef min |
#ifndef min |
| #define min(a, b) (((a) < (b)) ? (a) : (b)) |
#define min(a, b) (((a) < (b)) ? (a) : (b)) |
| #endif |
#endif |
| |
|
| |
/** Swap two numbers without using temporary variable */ |
| #ifndef swap |
#ifndef swap |
| #define swap(a, b) \ |
#define swap(a, b) \ |
| do { \ |
do { \ |
| (a) += (b); \ |
(a) += (b); \ |
| (b) = (a) - (b); \ |
(b) = (a) - (b); \ |
| (a) -= (b); \ |
(a) -= (b); \ |
| } while (0) |
} while (0) |
| #endif |
#endif |
| |
|
| #endif /* #ifndef _PLATON_MACROS_H */ |
#endif /* #ifndef _PLATON_MACROS_H */ |
Platon Group <platon@platon.sk> http://platon.sk/
|
|