2 * Copyright (c) 2000-2002 Sendmail, Inc. and its suppliers.
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.
9 * $Id: gen.h,v 1.22 2002/04/03 00:40:42 ca Exp $
13 ** libsm general definitions
14 ** See libsm/gen.html for documentation.
20 # include <sm/config.h>
21 # include <sm/cdefs.h>
22 # include <sm/types.h>
25 ** Define SM_RCSID and SM_IDSTR,
26 ** macros used to embed RCS and SCCS identification strings in object files.
30 # define SM_RCSID(str)
31 # define SM_IDSTR(id,str)
33 # define SM_RCSID(str) SM_UNUSED(static const char RcsId[]) = str;
34 # define SM_IDSTR(id,str) SM_UNUSED(static const char id[]) = str;
38 ** Define NULL and offsetof (from the C89 standard)
43 # else /* SM_CONF_STDDEF_H */
47 # define offsetof(type, member) ((size_t)(&((type *)0)->member))
48 # endif /* SM_CONF_STDDEF_H */
51 ** Define bool, true, false (from the C99 standard)
54 # if SM_CONF_STDBOOL_H
56 # else /* SM_CONF_STDBOOL_H */
62 # endif /* SM_CONF_STDBOOL_H */
65 ** Define SM_MAX and SM_MIN
68 # define SM_MAX(a, b) ((a) > (b) ? (a) : (b))
69 # define SM_MIN(a, b) ((a) < (b) ? (a) : (b))
71 /* Define SM_SUCCESS and SM_FAILURE */
73 # define SM_FAILURE (-1)
75 /* XXX This needs to be fixed when we start to use threads: */
76 typedef int SM_ATOMIC_INT_T
;
77 typedef unsigned int SM_ATOMIC_UINT_T
;