macros.h

00001 /*
00002 Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
00003 Copyright (C) 2005- The University of Notre Dame
00004 This software is distributed under the GNU General Public License.
00005 See the file COPYING for details.
00006 */
00007 
00008 #ifndef MACROS_H
00009 #define MACROS_H
00010 
00011 #ifndef MAX
00012 #define MAX(a,b) ( ((a)>(b)) ? (a) : (b) )
00013 #endif
00014 
00015 #ifndef MIN
00016 #define MIN(a,b) ( ((a)<(b)) ? (a) : (b) )
00017 #endif
00018 
00019 /* treat negative numbers  as 'nulls' */
00020 #ifndef MIN_POS
00021 #define MIN_POS(a,b) ((a) < 0 ? (b) : ((b) < 0 ? (a) : MIN((a), (b))))
00022 #endif
00023 
00024 #ifndef ABS
00025 #define ABS(x) ( ((x)>=0) ? (x) : (-(x)) )
00026 #endif
00027 
00028 #define DIV_INT_ROUND_UP(a, b) (((a) + (b) - 1) / (b))
00029 
00030 #define KILO 1024
00031 #define MEGA (KILO*KILO)
00032 #define GIGA (KILO*MEGA)
00033 #define TERA (KILO*GIGA)
00034 #define PETA (KILO*TERA)
00035 
00036 #define KILOBYTE KILO
00037 #define MEGABYTE MEGA
00038 #define GIGABYTE GIGA
00039 #define TERABYTE TERA
00040 #define PETABYTE PETA
00041 
00042 #define USECOND 1000000
00043 
00044 #endif

Generated on 17 Sep 2019 for cctools by  doxygen 1.6.1