1 /* 2 * Copyright (c) 2000-2001 Proofpoint, Inc. and its suppliers. 3 * All rights reserved. 4 * 5 * By using this file, you agree to the terms and conditions set 6 * forth in the LICENSE file which can be found at the top level of 7 * the sendmail distribution. 8 * 9 * $Id: limits.h,v 1.7 2013-11-22 20:51:31 ca Exp $ 10 */ 11 12 /* 13 ** <sm/limits.h> 14 ** This header file is a portability wrapper for <limits.h>. 15 ** It includes <limits.h>, then it ensures that the following macros 16 ** from the C 1999 standard for <limits.h> are defined: 17 ** LLONG_MIN, LLONG_MAX 18 ** ULLONG_MAX 19 */ 20 21 #ifndef SM_LIMITS_H 22 # define SM_LIMITS_H 23 24 # include <limits.h> 25 # include <sm/types.h> 26 # include <sys/param.h> 27 28 /* 29 ** The following assumes two's complement binary arithmetic. 30 */ 31 32 # ifndef LLONG_MIN 33 # define LLONG_MIN ((LONGLONG_T)(~(ULLONG_MAX >> 1))) 34 # endif /* ! LLONG_MIN */ 35 # ifndef LLONG_MAX 36 # define LLONG_MAX ((LONGLONG_T)(ULLONG_MAX >> 1)) 37 # endif /* ! LLONG_MAX */ 38 # ifndef ULLONG_MAX 39 # define ULLONG_MAX ((ULONGLONG_T)(-1)) 40 # endif /* ! ULLONG_MAX */ 41 42 /* 43 ** PATH_MAX is defined by the POSIX standard. All modern systems 44 ** provide it. Older systems define MAXPATHLEN in <sys/param.h> instead. 45 */ 46 47 # ifndef PATH_MAX 48 # ifdef MAXPATHLEN 49 # define PATH_MAX MAXPATHLEN 50 # else /* MAXPATHLEN */ 51 # define PATH_MAX 2048 52 # endif /* MAXPATHLEN */ 53 # endif /* ! PATH_MAX */ 54 55 #endif /* ! SM_LIMITS_H */ 56