|
Libparserutils
|
00001 /* 00002 * This file is part of LibParserUtils. 00003 * Licensed under the MIT License, 00004 * http://www.opensource.org/licenses/mit-license.php 00005 * Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org> 00006 */ 00007 00008 #ifndef parserutils_utils_h_ 00009 #define parserutils_utils_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 #ifndef SLEN 00020 /* Calculate length of a string constant */ 00021 #define SLEN(s) (sizeof((s)) - 1) /* -1 for '\0' */ 00022 #endif 00023 00024 #ifndef UNUSED 00025 #define UNUSED(x) ((x)=(x)) 00026 #endif 00027 00028 #ifndef N_ELEMENTS 00029 #define N_ELEMENTS(s) (sizeof((s)) / sizeof((s)[0])) 00030 #endif 00031 00032 #ifndef ALIGN 00033 #define ALIGN(val) (((val) + 3) & ~(3)) 00034 #endif 00035 00036 #endif
1.7.3