summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/include/sm/cdefs.h
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2002-02-17 21:56:45 +0000
committergshapiro <gshapiro@FreeBSD.org>2002-02-17 21:56:45 +0000
commit8449595fe97f4474b9b9a7e4edee1ef35dcff393 (patch)
treee7a33b132264d449a512ddf4a8685df097669c1d /contrib/sendmail/include/sm/cdefs.h
parent289b381b31415647269c7520d881017e2dcb27f1 (diff)
downloadFreeBSD-src-8449595fe97f4474b9b9a7e4edee1ef35dcff393.zip
FreeBSD-src-8449595fe97f4474b9b9a7e4edee1ef35dcff393.tar.gz
Import sendmail 8.12.2
Diffstat (limited to 'contrib/sendmail/include/sm/cdefs.h')
-rw-r--r--contrib/sendmail/include/sm/cdefs.h142
1 files changed, 142 insertions, 0 deletions
diff --git a/contrib/sendmail/include/sm/cdefs.h b/contrib/sendmail/include/sm/cdefs.h
new file mode 100644
index 0000000..b8597d9
--- /dev/null
+++ b/contrib/sendmail/include/sm/cdefs.h
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
+ * All rights reserved.
+ *
+ * By using this file, you agree to the terms and conditions set
+ * forth in the LICENSE file which can be found at the top level of
+ * the sendmail distribution.
+ *
+ * $Id: cdefs.h,v 1.14 2001/06/07 20:04:53 ca Exp $
+ */
+
+/*
+** libsm C language portability macros
+** See libsm/cdefs.html for documentation.
+*/
+
+#ifndef SM_CDEFS_H
+# define SM_CDEFS_H
+
+# include <sm/config.h>
+
+/*
+** BSD and Linux have <sys/cdefs.h> which defines a set of C language
+** portability macros that are a defacto standard in the open source
+** community.
+*/
+
+# if SM_CONF_SYS_CDEFS_H
+# include <sys/cdefs.h>
+# endif /* SM_CONF_SYS_CDEFS_H */
+
+/*
+** Define the standard C language portability macros
+** for platforms that lack <sys/cdefs.h>.
+*/
+
+# if !SM_CONF_SYS_CDEFS_H
+# if defined(__cplusplus)
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS };
+# else /* defined(__cplusplus) */
+# define __BEGIN_DECLS
+# define __END_DECLS
+# endif /* defined(__cplusplus) */
+# if defined(__STDC__) || defined(__cplusplus)
+# define __P(protos) protos
+# define __CONCAT(x,y) x ## y
+# define __STRING(x) #x
+# else /* defined(__STDC__) || defined(__cplusplus) */
+# define __P(protos) ()
+# define __CONCAT(x,y) x/**/y
+# define __STRING(x) "x"
+# define const
+# define signed
+# define volatile
+# endif /* defined(__STDC__) || defined(__cplusplus) */
+# endif /* !SM_CONF_SYS_CDEFS_H */
+
+/*
+** Define SM_DEAD, a macro used to declare functions that do not return
+** to their caller.
+*/
+
+# ifndef SM_DEAD
+# if __GNUC__ >= 2
+# if __GNUC__ == 2 && __GNUC_MINOR__ < 5
+# define SM_DEAD(proto) volatile proto
+# else /* __GNUC__ == 2 && __GNUC_MINOR__ < 5 */
+# define SM_DEAD(proto) proto __attribute__((__noreturn__))
+# endif /* __GNUC__ == 2 && __GNUC_MINOR__ < 5 */
+# else /* __GNUC__ >= 2 */
+# define SM_DEAD(proto) proto
+# endif /* __GNUC__ >= 2 */
+# endif /* SM_DEAD */
+
+/*
+** Define SM_UNUSED, a macro used to declare variables that may be unused.
+*/
+
+# ifndef SM_UNUSED
+# if __GNUC__ >= 2
+# if __GNUC__ == 2 && __GNUC_MINOR__ < 7
+# define SM_UNUSED(decl) decl
+# else /* __GNUC__ == 2 && __GNUC_MINOR__ < 7 */
+# define SM_UNUSED(decl) decl __attribute__((__unused__))
+# endif /* __GNUC__ == 2 && __GNUC_MINOR__ < 7 */
+# else /* __GNUC__ >= 2 */
+# define SM_UNUSED(decl) decl
+# endif /* __GNUC__ >= 2 */
+# endif /* SM_UNUSED */
+
+/*
+** The SM_NONVOLATILE macro is used to declare variables that are not
+** volatile, but which must be declared volatile when compiling with
+** gcc -O -Wall in order to suppress bogus warning messages.
+**
+** Variables that actually are volatile should be declared volatile
+** using the "volatile" keyword. If a variable actually is volatile,
+** then SM_NONVOLATILE should not be used.
+**
+** To compile sendmail with gcc and see all non-bogus warnings,
+** you should use
+** gcc -O -Wall -DSM_OMIT_BOGUS_WARNINGS ...
+** Do not use -DSM_OMIT_BOGUS_WARNINGS when compiling the production
+** version of sendmail, because there is a performance hit.
+*/
+
+# ifdef SM_OMIT_BOGUS_WARNINGS
+# define SM_NONVOLATILE volatile
+# else /* SM_OMIT_BOGUS_WARNINGS */
+# define SM_NONVOLATILE
+# endif /* SM_OMIT_BOGUS_WARNINGS */
+
+/*
+** Turn on format string argument checking.
+*/
+
+# ifndef SM_CONF_FORMAT_TEST
+# if __GNUC__ == 2 && __GNUC_MINOR__ >= 7
+# define SM_CONF_FORMAT_TEST 1
+# else /* __GNUC__ == 2 && __GNUC_MINOR__ >= 7 */
+# define SM_CONF_FORMAT_TEST 0
+# endif /* __GNUC__ == 2 && __GNUC_MINOR__ >= 7 */
+# endif /* SM_CONF_FORMAT_TEST */
+
+# ifndef PRINTFLIKE
+# if SM_CONF_FORMAT_TEST
+# define PRINTFLIKE(x,y) __attribute__ ((__format__ (__printf__, x, y)))
+# else /* SM_CONF_FORMAT_TEST */
+# define PRINTFLIKE(x,y)
+# endif /* SM_CONF_FORMAT_TEST */
+# endif /* ! PRINTFLIKE */
+
+# ifndef SCANFLIKE
+# if SM_CONF_FORMAT_TEST
+# define SCANFLIKE(x,y) __attribute__ ((__format__ (__scanf__, x, y)))
+# else /* SM_CONF_FORMAT_TEST */
+# define SCANFLIKE(x,y)
+# endif /* SM_CONF_FORMAT_TEST */
+# endif /* ! SCANFLIKE */
+
+#endif /* ! SM_CDEFS_H */
OpenPOWER on IntegriCloud