diff --git a/src/common/assoc_mgr.h b/src/common/assoc_mgr.h index 382cc7f4a80ea83ba2d3b3850bb4d9c5fb089faa..0570d33e492c4beaac5c289a4d4da55d78b57b3f 100644 --- a/src/common/assoc_mgr.h +++ b/src/common/assoc_mgr.h @@ -44,9 +44,7 @@ #ifndef _SLURM_ASSOC_MGR_H #define _SLURM_ASSOC_MGR_H -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include "src/common/list.h" #include "src/common/slurm_accounting_storage.h" diff --git a/src/common/bitstring.h b/src/common/bitstring.h index 42e37c5aaf811a99bce4d8a6453f7d9c211defb0..0f337493f18226ee68f5b2a36d008574ec86dae6 100644 --- a/src/common/bitstring.h +++ b/src/common/bitstring.h @@ -57,9 +57,7 @@ #ifndef _BITSTRING_H_ #define _BITSTRING_H_ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> diff --git a/src/common/callerid.c b/src/common/callerid.c index 878cac4d0a46079380f7e6b36348e97282af7f83..35101612c50da855fcd749edc3e69c261395a9fe 100644 --- a/src/common/callerid.c +++ b/src/common/callerid.c @@ -34,9 +34,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #ifndef _GNU_SOURCE # define _GNU_SOURCE diff --git a/src/common/cbuf.c b/src/common/cbuf.c index 85af0486dbac6520ee67689a87030b32cf5c728a..4461104ea20d733aaa14d8495844be86af61a911 100644 --- a/src/common/cbuf.c +++ b/src/common/cbuf.c @@ -36,9 +36,7 @@ *****************************************************************************/ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif /* HAVE_CONFIG_H */ +#include "config.h" #include <assert.h> #include <errno.h> diff --git a/src/common/cpu_frequency.c b/src/common/cpu_frequency.c index adf715d5c4fbdeb062737ef26485afa9f4a0c904..08514bb3b52390906390e8656f6834ac8d2a74fd 100644 --- a/src/common/cpu_frequency.c +++ b/src/common/cpu_frequency.c @@ -37,17 +37,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H #include "config.h" -#endif -#include <sys/types.h> -#include <sys/stat.h> #include <ctype.h> #include <errno.h> #include <fcntl.h> #include <limits.h> #include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> #include "slurm/slurm.h" diff --git a/src/common/daemonize.c b/src/common/daemonize.c index b84a839bed10ea1caf52e26d1adfad66a5a086cd..a423af9e53c8e708ef1047458947dda4dc2b3240 100644 --- a/src/common/daemonize.c +++ b/src/common/daemonize.c @@ -36,15 +36,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include <config.h> -#endif +#include <config.h> #include <fcntl.h> -#include <unistd.h> #include <sys/resource.h> #include <sys/stat.h> #include <sys/types.h> +#include <unistd.h> #include "src/common/daemonize.h" #include "src/common/fd.h" diff --git a/src/common/eio.c b/src/common/eio.c index 93ec62ef0cdfbdbc91c40a42cb98d7b1a2ae7bd5..a9fc0abe71e93af14384678b904fac937dee8cfb 100644 --- a/src/common/eio.c +++ b/src/common/eio.c @@ -35,15 +35,14 @@ * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include <config.h> -#endif +#include <config.h> + +#include <errno.h> #include <poll.h> #include <sys/types.h> #include <sys/socket.h> #include <unistd.h> -#include <errno.h> #include "src/common/fd.h" #include "src/common/eio.h" diff --git a/src/common/env.c b/src/common/env.c index debf307e556389a9d5a7eb27e14ab357d3c79bab..01e586a131b30c5de9c4fe81240cdc2477db03e8 100644 --- a/src/common/env.c +++ b/src/common/env.c @@ -37,9 +37,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <fcntl.h> #include <poll.h> diff --git a/src/common/fd.c b/src/common/fd.c index 9c4a413ee4b52656c59a72221262d1a13187aca6..90833168a29d8c98760e5cd2223f2a117b994446 100644 --- a/src/common/fd.c +++ b/src/common/fd.c @@ -35,10 +35,7 @@ * Refer to "fd.h" for documentation on public functions. \*****************************************************************************/ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif /* HAVE_CONFIG_H */ +#include "config.h" #include <assert.h> #include <errno.h> diff --git a/src/common/fd.h b/src/common/fd.h index 37c7c6511d9dda4580cad886cae2efba244b9186..f8edbfa305ca2c6f3749e8fcf578c563c3a6155b 100644 --- a/src/common/fd.h +++ b/src/common/fd.h @@ -35,14 +35,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ - #ifndef _FD_H #define _FD_H - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif /* HAVE_CONFIG_H */ +#include "config.h" #include <fcntl.h> #include <sys/stat.h> diff --git a/src/common/forward.c b/src/common/forward.c index 5935172a205b5f37db5617b9ff89864f0b10cfb2..0d6457430a303044793a9d7ed9bcac666ab62872 100644 --- a/src/common/forward.c +++ b/src/common/forward.c @@ -37,9 +37,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <errno.h> #include <pthread.h> diff --git a/src/common/gres.c b/src/common/gres.c index d71f30390f4abbda4abbe29e1e7d951974e13322..9497a6c13ef12e82009a24b4ec6775d339db5301 100644 --- a/src/common/gres.c +++ b/src/common/gres.c @@ -37,10 +37,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ +#include "config.h" + #define _GNU_SOURCE -#if HAVE_CONFIG_H -# include "config.h" -#endif #ifdef __FreeBSD__ # include <sys/param.h> diff --git a/src/common/hostlist.c b/src/common/hostlist.c index 01ea2e78a400b3ed67f8c784ed7934fccaee8563..45cd7b7f8383704aa7827264ec0cbd5edbc13b7c 100644 --- a/src/common/hostlist.c +++ b/src/common/hostlist.c @@ -36,9 +36,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <assert.h> #include <ctype.h> diff --git a/src/common/io_hdr.c b/src/common/io_hdr.c index 5fda5665c6f82bf98db3ae9fb21cc2275924a5e8..ecb796daa7d2bc11a97b150b8857d20c9caa5769 100644 --- a/src/common/io_hdr.c +++ b/src/common/io_hdr.c @@ -36,9 +36,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include "src/common/fd.h" #include "src/common/io_hdr.h" diff --git a/src/common/io_hdr.h b/src/common/io_hdr.h index 75b547be0ac0fdda5cfc9872d92cf4d540bd6f64..fd4928a38258c63f850f8533b959b70b7f3f60fb 100644 --- a/src/common/io_hdr.h +++ b/src/common/io_hdr.h @@ -39,9 +39,7 @@ #ifndef _HAVE_IO_HDR_H #define _HAVE_IO_HDR_H -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> diff --git a/src/common/job_options.c b/src/common/job_options.c index 3787bdd945f1c6afcfd18ad57a6c96048e29e675..9cbb316e931935160b4930f7a01e58df9c6602bc 100644 --- a/src/common/job_options.c +++ b/src/common/job_options.c @@ -36,9 +36,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include "slurm/slurm.h" #include "src/common/xassert.h" diff --git a/src/common/job_options.h b/src/common/job_options.h index c89b41ab821bb85d460b53f9602f0fc77d2e75a8..7723dff83a44fec95c5057b9d24b1dca1349d4c2 100644 --- a/src/common/job_options.h +++ b/src/common/job_options.h @@ -39,9 +39,7 @@ #ifndef _JOB_OPTIONS_H #define _JOB_OPTIONS_H -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include "src/common/pack.h" diff --git a/src/common/job_resources.h b/src/common/job_resources.h index 170bd28e95b63317e3690a19d7de742ffd3a3f06..6c8456ec51d4841669f2db20aa8384342a6d6d4b 100644 --- a/src/common/job_resources.h +++ b/src/common/job_resources.h @@ -39,9 +39,7 @@ #ifndef _JOB_RESOURCES_H #define _JOB_RESOURCES_H -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> diff --git a/src/common/list.c b/src/common/list.c index db9ed3af4208960b486d9f4ee0a2e773e531fa99..2947b1f6931f5cee3730c0f5af479f37e7d2bba4 100644 --- a/src/common/list.c +++ b/src/common/list.c @@ -35,10 +35,7 @@ * Refer to "list.h" for documentation on public functions. *****************************************************************************/ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif /* HAVE_CONFIG_H */ +#include "config.h" #include <assert.h> #include <errno.h> @@ -46,10 +43,11 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> + #include "list.h" +#include "log.h" #include "macros.h" #include "xmalloc.h" -#include "src/common/log.h" /* ** Define slurm-specific aliases for use by plugins, see slurm_xlator.h diff --git a/src/common/log.c b/src/common/log.c index 6a69e3c0f15272535002cdf3d1e553f170a08663..19c37e70c40141389a6ad701368cfd4098f6cea6 100644 --- a/src/common/log.c +++ b/src/common/log.c @@ -50,16 +50,14 @@ # define _GNU_SOURCE #endif -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" +#include <errno.h> +#include <poll.h> +#include <pthread.h> #include <stdarg.h> #include <stdio.h> #include <string.h> -#include <errno.h> -#include <pthread.h> -#include <poll.h> #include <sys/socket.h> #include <sys/stat.h> #include <sys/time.h> diff --git a/src/common/log.h b/src/common/log.h index d8a96fd2f9df30a803fac67ea872fd20f873b5d5..c906863c13968b35ef653de989f3c41f1383160b 100644 --- a/src/common/log.h +++ b/src/common/log.h @@ -46,9 +46,7 @@ #ifndef _LOG_H #define _LOG_H -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #ifdef HAVE_SYS_SYSLOG_H # include <sys/syslog.h> diff --git a/src/common/macros.h b/src/common/macros.h index 3242560ea5f9e8401dad8a123f2a052bf0b01935..507c1ff6aafdfa005b1691cdc94ae8024020d9fe 100644 --- a/src/common/macros.h +++ b/src/common/macros.h @@ -37,11 +37,9 @@ \*****************************************************************************/ #ifndef _MACROS_H -#define _MACROS_H 1 +#define _MACROS_H -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <errno.h> /* for errno */ #include <pthread.h> diff --git a/src/common/mpi.c b/src/common/mpi.c index a31ffb5d51f9800caee415ff033cd673447c01bd..28b4b71d26b04735922809288cbb5dbf3469897b 100644 --- a/src/common/mpi.c +++ b/src/common/mpi.c @@ -36,12 +36,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" -#include <unistd.h> #include <stdlib.h> +#include <unistd.h> #include "src/common/env.h" #include "src/common/macros.h" diff --git a/src/common/msg_aggr.c b/src/common/msg_aggr.c index 84221f94b6ba53ea009b008ca81c5e53f86e446a..cef0356b04cc54b272e5ed0aefc6efb9f89ec94d 100644 --- a/src/common/msg_aggr.c +++ b/src/common/msg_aggr.c @@ -39,9 +39,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <pthread.h> diff --git a/src/common/node_conf.c b/src/common/node_conf.c index e0b1d9464c806d25e8fd194e2a287440595767bd..7abc8988674d80ec34445b43d8d454c1d77d94fa 100644 --- a/src/common/node_conf.c +++ b/src/common/node_conf.c @@ -43,9 +43,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <ctype.h> #include <errno.h> diff --git a/src/common/node_conf.h b/src/common/node_conf.h index 771cb76d2d9637c08f9a9fe34bce4cdd065af231..0aa6eb02d36db29bcbeab0b4d7274a17db4ed526 100644 --- a/src/common/node_conf.h +++ b/src/common/node_conf.h @@ -42,9 +42,7 @@ #ifndef _HAVE_NODE_CONF_H #define _HAVE_NODE_CONF_H -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> #include <time.h> diff --git a/src/common/node_features.c b/src/common/node_features.c index 7954a404934cb3b5ed8c71b0d2815ec5825d697b..877b0b9f98eca69fb6d25317b94a12e4898d96e5 100644 --- a/src/common/node_features.c +++ b/src/common/node_features.c @@ -35,9 +35,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> #include <string.h> diff --git a/src/common/node_select.c b/src/common/node_select.c index 84906bdeba30c4032152d7e929b7335116f85cda..0782830ab07573a03af7ab8572781a29a9f4d42b 100644 --- a/src/common/node_select.c +++ b/src/common/node_select.c @@ -45,12 +45,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" -#include <pthread.h> #include <dirent.h> +#include <pthread.h> #include "src/common/list.h" #include "src/common/node_select.h" diff --git a/src/common/node_select.h b/src/common/node_select.h index d682071018d150227acd1ae21121f77e34445dc3..076b90dc08664100ae442e3782bf216ebf9af28f 100644 --- a/src/common/node_select.h +++ b/src/common/node_select.h @@ -40,9 +40,7 @@ #ifndef _NODE_SELECT_H #define _NODE_SELECT_H -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif /* HAVE_CONFIG_H */ +#include "config.h" #include "slurm/slurm.h" #include "slurm/slurm_errno.h" diff --git a/src/common/optz.c b/src/common/optz.c index eb7e3c135278f78e86e56dd94f726faf857b313f..588731e8c4eb91dd1ddc7497d99d444d1747bb63 100644 --- a/src/common/optz.c +++ b/src/common/optz.c @@ -35,9 +35,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include <config.h> -#endif +#include "config.h" #include <string.h> diff --git a/src/common/optz.h b/src/common/optz.h index 708ebdfefac7f42bd445d32f86d3471b68be6cf3..2d9e2ab20ea7a49928f2f0ec172f5f48807d34f6 100644 --- a/src/common/optz.h +++ b/src/common/optz.h @@ -38,9 +38,7 @@ #ifndef _OPTZ_H #define _OPTZ_H -#if HAVE_CONFIG_H -# include <config.h> -#endif +#include "config.h" #ifndef _GNU_SOURCE # define _GNU_SOURCE diff --git a/src/common/pack.c b/src/common/pack.c index 591c6a8d436425447c46827d6d8d2e992f3588b4..c817b472ace35dfb53e91ce21b2c381123194440 100644 --- a/src/common/pack.c +++ b/src/common/pack.c @@ -39,16 +39,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" -#include <stdlib.h> #include <errno.h> +#include <inttypes.h> #include <netinet/in.h> +#include <stdlib.h> #include <string.h> #include <time.h> -#include <inttypes.h> #include "slurm/slurm_errno.h" diff --git a/src/common/pack.h b/src/common/pack.h index 54413317451b34bfbcff53f4a09f16421a7bf45e..71f817dc13d8132e5dd8e9def9aac6ff71388398 100644 --- a/src/common/pack.h +++ b/src/common/pack.h @@ -41,9 +41,7 @@ #ifndef _PACK_INCLUDED #define _PACK_INCLUDED -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <assert.h> #include <inttypes.h> diff --git a/src/common/parse_config.c b/src/common/parse_config.c index 8bb15b7e0c13c3ee9ecdfdd8e10e716632a64f2d..0d802fa41234fb6367c875b8ee362c3ff94dc4a5 100644 --- a/src/common/parse_config.c +++ b/src/common/parse_config.c @@ -39,9 +39,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <ctype.h> #include <regex.h> diff --git a/src/common/parse_spec.c b/src/common/parse_spec.c index e10e6a5e6e70e2974b276dfdc5e435e3eed62d9b..ede836b29e1d46663a2c6a4702b2ade038996463 100644 --- a/src/common/parse_spec.c +++ b/src/common/parse_spec.c @@ -36,20 +36,18 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif +#include <ctype.h> +#include <errno.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <ctype.h> -#include <errno.h> #include "src/common/log.h" #include "src/common/parse_spec.h" diff --git a/src/common/parse_spec.h b/src/common/parse_spec.h index 201527ffd4cf1238ad4f4bc0623526ae46e97a93..3ed24a3cda152fd2fc8a1a1d3a03a259cf24ff58 100644 --- a/src/common/parse_spec.h +++ b/src/common/parse_spec.h @@ -39,9 +39,7 @@ #ifndef _SLURM_PARSE_H_ #define _SLURM_PARSE_H_ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> diff --git a/src/common/parse_time.c b/src/common/parse_time.c index 86db6286eaf280813289c6be088331c49b075b28..ed4e8d2c092c2fb047070f85231f2862f09240ac 100644 --- a/src/common/parse_time.c +++ b/src/common/parse_time.c @@ -36,9 +36,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <limits.h> #include <stdio.h> diff --git a/src/common/parse_time.h b/src/common/parse_time.h index 775584179df6c9752dc544ac1e9897fb66093194..5cd2a09cc5efd37f286fc831d7fc968c17344a11 100644 --- a/src/common/parse_time.h +++ b/src/common/parse_time.h @@ -39,12 +39,9 @@ #ifndef _PARSE_TIME_H_ #define _PARSE_TIME_H_ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> - #include <time.h> /* Convert string to equivalent time value diff --git a/src/common/plugin.c b/src/common/plugin.c index 2e72f943a7a6d91761f8672857522d5292e80d9a..83c05f5f6e4ed556f3439db7481b82421f1790ab 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -39,15 +39,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" +#include <dlfcn.h> #include <errno.h> -#include <sys/types.h> #include <stdio.h> -#include <dlfcn.h> /* don't know if there's an autoconf for this. */ #include <string.h> +#include <sys/types.h> #include "src/common/xmalloc.h" #include "src/common/log.h" diff --git a/src/common/plugin.h b/src/common/plugin.h index 2e1e57eee34eaafd411ccb2f8f5cbd7de1b4b6ec..d8205d1cd68536f641aac1d036ca8db4af1f1c8b 100644 --- a/src/common/plugin.h +++ b/src/common/plugin.h @@ -39,9 +39,7 @@ #ifndef __GENERIC_PLUGIN_H__ #define __GENERIC_PLUGIN_H__ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> #include <sys/types.h> diff --git a/src/common/plugrack.c b/src/common/plugrack.c index 4dca7f731331e6afe6bb996dc3d8ae84c1dd94a9..5c134facbbaf292cc1a8f447db02a01c6fdbc918 100644 --- a/src/common/plugrack.c +++ b/src/common/plugrack.c @@ -37,50 +37,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" - -# if HAVE_DIRENT_H -# include <dirent.h> -# define NAMLEN(dirent) strlen((dirent)->d_name) -# else /* ! HAVE_DIRENT_H */ -# define dirent direct -# define NAMLEN(dirent) (dirent)->d_namlen -# endif /* HAVE_DIRENT_H */ - -# if STDC_HEADERS -# include <string.h> -# else /* ! STDC_HEADERS */ -# if !HAVE_STRCHR -# define strchr index -# define strrchr rindex -char *strchr(), *strrchr(); -# endif /* HAVE_STRCHR */ -# endif /* STDC_HEADERS */ - -# if HAVE_UNISTD_H -# include <unistd.h> -# endif /* HAVE_UNISTD_H */ -# if HAVE_SYS_TYPES_H -# include <sys/types.h> -# endif -# if HAVE_SYS_STAT_H -# include <sys/stat.h> -# endif - -# if HAVE_STDLIB_H -# include <stdlib.h> -# endif - -#else /* ! HAVE_CONFIG_H */ -# include <dirent.h> -# include <string.h> -# include <stdlib.h> -# include <unistd.h> -# include <dirent.h> -# include <sys/types.h> -# include <sys/stat.h> -#endif /* HAVE_CONFIG_H */ +#include "config.h" + +#include <dirent.h> +#include <stdlib.h> +#include <string.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <unistd.h> #include "src/common/macros.h" #include "src/common/xassert.h" diff --git a/src/common/plugstack.c b/src/common/plugstack.c index 4f52c0cb6844d4026a596e23252ecf26fbb9d397..1293ae75dd6622ea9327d2807507c771f0136fb2 100644 --- a/src/common/plugstack.c +++ b/src/common/plugstack.c @@ -36,16 +36,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include <config.h> -#endif +#include <config.h> -#include <string.h> #include <ctype.h> -#include <stdlib.h> -#include <libgen.h> -#include <glob.h> #include <dlfcn.h> +#include <glob.h> +#include <libgen.h> +#include <stdlib.h> +#include <string.h> #include "src/common/plugin.h" #include "src/common/xmalloc.h" diff --git a/src/common/plugstack.h b/src/common/plugstack.h index 9ba620c2f8584151fdd82aad8efdf188cf5b7592..bb02d8b004f4a721c3b018aa59cbb8b797b909b5 100644 --- a/src/common/plugstack.h +++ b/src/common/plugstack.h @@ -38,9 +38,7 @@ #ifndef _PLUGSTACK_H #define _PLUGSTACK_H -#if HAVE_CONFIG_H -# include <config.h> -#endif +#include <config.h> #ifndef _GNU_SOURCE # define _GNU_SOURCE diff --git a/src/common/power.h b/src/common/power.h index a7d347445a6605ac0588594236322b4702789068..94699490c532cc8b9a5ec7fc15667ba175d59fac 100644 --- a/src/common/power.h +++ b/src/common/power.h @@ -35,11 +35,9 @@ \*****************************************************************************/ #ifndef _SLURM_POWER_H -#define _SLURM_POWER_H 1 +#define _SLURM_POWER_H -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include "src/common/macros.h" #include "src/common/pack.h" diff --git a/src/common/print_fields.h b/src/common/print_fields.h index 2feae07dccb6f0a72b1e25718a474a084266195b..51bec16f6b8cd73842138efe617492c6901c27d8 100644 --- a/src/common/print_fields.h +++ b/src/common/print_fields.h @@ -39,15 +39,13 @@ #ifndef __PRINT_FIELDS_H__ #define __PRINT_FIELDS_H__ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <ctype.h> #include <errno.h> +#include <getopt.h> #include <stdio.h> #include <stdlib.h> -#include <getopt.h> #include <string.h> #include <time.h> #include <unistd.h> diff --git a/src/common/proc_args.c b/src/common/proc_args.c index 086ccfc5de083f9a1e11d2916896ba5398850a59..8a81dce9b650c0628b00623565ddc271848c4c6c 100644 --- a/src/common/proc_args.c +++ b/src/common/proc_args.c @@ -36,18 +36,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #ifndef __USE_ISOC99 #define __USE_ISOC99 #endif -#ifdef HAVE_LIMITS_H -# include <limits.h> -#endif - #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif @@ -58,6 +52,7 @@ #include <ctype.h> /* isdigit */ #include <fcntl.h> +#include <limits.h> #include <pwd.h> /* getpwuid */ #include <stdarg.h> /* va_start */ #include <stdio.h> diff --git a/src/common/proc_args.h b/src/common/proc_args.h index e9023ebc4be88216dec64fe36922e404b0d99e95..619fe3d6188de62ed715ae82f642a3b7bf28b304 100644 --- a/src/common/proc_args.h +++ b/src/common/proc_args.h @@ -38,10 +38,7 @@ #ifndef _PROC_ARGS_H #define _PROC_ARGS_H - -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <sys/types.h> #include <unistd.h> diff --git a/src/common/read_config.c b/src/common/read_config.c index 5fb7ff591b36f0f6fd497d9c25d4647215690187..d58c38c5158fad97ecddef1efa583fdbe4aac3cb 100644 --- a/src/common/read_config.c +++ b/src/common/read_config.c @@ -44,9 +44,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <arpa/inet.h> #include <assert.h> diff --git a/src/common/safeopen.c b/src/common/safeopen.c index 6ad97d1056183e918a5eb41df145c38adb9fe0e5..51c62896fb8efbee435367a6a31551dbadbd348a 100644 --- a/src/common/safeopen.c +++ b/src/common/safeopen.c @@ -35,20 +35,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ +#include "config.h" -#if HAVE_CONFIG_H -# include "config.h" -#endif - -#if HAVE_UNISTD_H -# include <unistd.h> -#endif #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> +#include <unistd.h> #include "src/common/safeopen.h" #include "src/common/xassert.h" diff --git a/src/common/slurm_accounting_storage.c b/src/common/slurm_accounting_storage.c index 9387862020ac9427973603ac5083199e15774364..bd055859a4db7b13911853b1f472a108bd176713 100644 --- a/src/common/slurm_accounting_storage.c +++ b/src/common/slurm_accounting_storage.c @@ -37,9 +37,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #ifndef _GNU_SOURCE # define _GNU_SOURCE diff --git a/src/common/slurm_acct_gather.h b/src/common/slurm_acct_gather.h index 743a228ef84cd3ee606a5a1477b3b35864b443aa..048ef2eb9338d8d6ffa6576f055ceb4d020f2cb2 100644 --- a/src/common/slurm_acct_gather.h +++ b/src/common/slurm_acct_gather.h @@ -38,9 +38,7 @@ #ifndef __SLURM_ACCT_GATHER_H__ #define __SLURM_ACCT_GATHER_H__ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> diff --git a/src/common/slurm_acct_gather_energy.h b/src/common/slurm_acct_gather_energy.h index d876ccaf01bcf699b1c21567c0f26b644eea56f0..9d454e074e3db93ffbc116d256521500b5fb5971 100644 --- a/src/common/slurm_acct_gather_energy.h +++ b/src/common/slurm_acct_gather_energy.h @@ -38,9 +38,7 @@ #ifndef __SLURM_ACCT_GATHER_ENERGY_H__ #define __SLURM_ACCT_GATHER_ENERGY_H__ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> #include <sys/resource.h> diff --git a/src/common/slurm_acct_gather_filesystem.h b/src/common/slurm_acct_gather_filesystem.h index 13d45cba4f5c0674dc4818f4247c2bdaffc7ec99..e4a623a2eb0aedeeee0602a99ecce408b7dfcf6f 100644 --- a/src/common/slurm_acct_gather_filesystem.h +++ b/src/common/slurm_acct_gather_filesystem.h @@ -38,9 +38,7 @@ #ifndef __SLURM_ACCT_GATHER_FILESYSTEM_H__ #define __SLURM_ACCT_GATHER_FILESYSTEM_H__ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> #include <sys/resource.h> diff --git a/src/common/slurm_acct_gather_infiniband.h b/src/common/slurm_acct_gather_infiniband.h index 85e0ed35babcb6d3a187224a711502456f48ca87..7142c09536e47957c27a43b75ff1fc2973906107 100644 --- a/src/common/slurm_acct_gather_infiniband.h +++ b/src/common/slurm_acct_gather_infiniband.h @@ -38,9 +38,7 @@ #ifndef __SLURM_ACCT_GATHER_INFINIBAND_H__ #define __SLURM_ACCT_GATHER_INFINIBAND_H__ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> #include <sys/resource.h> diff --git a/src/common/slurm_acct_gather_profile.h b/src/common/slurm_acct_gather_profile.h index 48a8ef4118a0f66028d85caddf2e2e646335512f..f83eab6f940da21f711053907371a13b6bdbeeb5 100644 --- a/src/common/slurm_acct_gather_profile.h +++ b/src/common/slurm_acct_gather_profile.h @@ -39,9 +39,7 @@ #ifndef __SLURM_ACCT_GATHER_PROFILE_H__ #define __SLURM_ACCT_GATHER_PROFILE_H__ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> #include <sys/resource.h> diff --git a/src/common/slurm_auth.h b/src/common/slurm_auth.h index 00f0fa17f3714fc464e6e1410144a3cfaca2a992..f4972c55303b308534ebbe50a95810f87c71a02c 100644 --- a/src/common/slurm_auth.h +++ b/src/common/slurm_auth.h @@ -39,13 +39,10 @@ #ifndef __SLURM_AUTHENTICATION_H__ #define __SLURM_AUTHENTICATION_H__ -#include <stdio.h> - -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> +#include <stdio.h> #include "src/common/plugrack.h" #include "src/common/pack.h" diff --git a/src/common/slurm_cred.c b/src/common/slurm_cred.c index 0a10bb32dd3b9915d8180b3cdc2ed578e9bc398b..4ebf9f5428cd3ee405fdfa3b99f86bd3759eee19 100644 --- a/src/common/slurm_cred.c +++ b/src/common/slurm_cred.c @@ -38,9 +38,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <fcntl.h> #include <pthread.h> diff --git a/src/common/slurm_cred.h b/src/common/slurm_cred.h index 1c17cb91f97de95e2e331e0be50a99f845c01c00..052d5c6e45f435f06b75c272b8f70022890f4996 100644 --- a/src/common/slurm_cred.h +++ b/src/common/slurm_cred.h @@ -40,13 +40,9 @@ #ifndef _HAVE_SLURM_CRED_H #define _HAVE_SLURM_CRED_H -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #if HAVE_SYS_TYPES_H # include <sys/types.h> diff --git a/src/common/slurm_errno.c b/src/common/slurm_errno.c index 688a26854a8fdf9f4826f1c20dafb3dc82d35165..6038522a86c95754a22a391913dd6243b15be2b5 100644 --- a/src/common/slurm_errno.c +++ b/src/common/slurm_errno.c @@ -44,13 +44,11 @@ * their description strings. */ -#if HAVE_CONFIG_H #include "config.h" -#endif -#include <stdlib.h> #include <errno.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> #include "slurm/slurm_errno.h" diff --git a/src/common/slurm_ext_sensors.h b/src/common/slurm_ext_sensors.h index 33136621d3298a6b393f297cedfb2e48848ac600..37b7cedc82a0e0bcc9ef77dbbe85afa6b82e83bb 100644 --- a/src/common/slurm_ext_sensors.h +++ b/src/common/slurm_ext_sensors.h @@ -38,9 +38,7 @@ #ifndef __SLURM_EXT_SENSORS_H__ #define __SLURM_EXT_SENSORS_H__ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> #include <sys/resource.h> diff --git a/src/common/slurm_jobacct_gather.h b/src/common/slurm_jobacct_gather.h index 163524797bcfea6fa834f8157ee99a60b047d72a..cea02c2c2b8ebb52172cfbc13ab2dea3062058d5 100644 --- a/src/common/slurm_jobacct_gather.h +++ b/src/common/slurm_jobacct_gather.h @@ -50,9 +50,7 @@ #ifndef __SLURM_JOBACCT_GATHER_H__ #define __SLURM_JOBACCT_GATHER_H__ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> #include <sys/resource.h> diff --git a/src/common/slurm_jobcomp.c b/src/common/slurm_jobcomp.c index 678f4dfbb7fa48597c8b53ea23632331d4039df6..403e30ddf75885b2ca506b7c699a5738722cad3a 100644 --- a/src/common/slurm_jobcomp.c +++ b/src/common/slurm_jobcomp.c @@ -38,9 +38,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <pthread.h> #include <stdlib.h> diff --git a/src/common/slurm_jobcomp.h b/src/common/slurm_jobcomp.h index f7155565394130234cbcc8a442c323a4de373b7c..6fb8ee29b7158f69dbfc95021b222406ed830211 100644 --- a/src/common/slurm_jobcomp.h +++ b/src/common/slurm_jobcomp.h @@ -40,9 +40,7 @@ #ifndef __SLURM_JOBCOMP_H__ #define __SLURM_JOBCOMP_H__ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> #include <sys/types.h> diff --git a/src/common/slurm_mcs.h b/src/common/slurm_mcs.h index e4cfa610a27ed37fd57e570ecf65ed1381fc7cba..2683bde9d4b911c7dfface36c714eff7efcd1e8f 100644 --- a/src/common/slurm_mcs.h +++ b/src/common/slurm_mcs.h @@ -37,9 +37,7 @@ #ifndef _SLURM_MCS_H #define _SLURM_MCS_H -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> diff --git a/src/common/slurm_mpi.h b/src/common/slurm_mpi.h index 12c012123418a8f7fb5bc54c5abc65745fcfe765..147f43bc2db2ea43625c053fe0c454817bdf5812 100644 --- a/src/common/slurm_mpi.h +++ b/src/common/slurm_mpi.h @@ -39,11 +39,10 @@ #ifndef _SRUN_MPI_H #define _SRUN_MPI_H -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <stdbool.h> + #include "slurm/slurm.h" #include "src/slurmd/slurmstepd/slurmstepd_job.h" diff --git a/src/common/slurm_priority.h b/src/common/slurm_priority.h index 3b786af2f1d722dac2ceac4c516e1dca0d4318d1..739f1b1ad4d91fdae59ea647a05fc3c9f79e06f7 100644 --- a/src/common/slurm_priority.h +++ b/src/common/slurm_priority.h @@ -39,9 +39,7 @@ #ifndef _SLURM_PRIORITY_H #define _SLURM_PRIORITY_H -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> diff --git a/src/common/slurm_protocol_api.c b/src/common/slurm_protocol_api.c index ed400960af73c4d8a3670202dcd31ab8e890da2a..0191b98d12fb52b984ca97146122917e8cb16d4a 100644 --- a/src/common/slurm_protocol_api.c +++ b/src/common/slurm_protocol_api.c @@ -39,9 +39,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" /* GLOBAL INCLUDES */ diff --git a/src/common/slurm_protocol_api.h b/src/common/slurm_protocol_api.h index bd8e164381d6d21c17ca0e784bea6de968ed547d..ed85ed99f2ff1cc51c9c7d6f2ddfb85bd06a0877 100644 --- a/src/common/slurm_protocol_api.h +++ b/src/common/slurm_protocol_api.h @@ -42,9 +42,7 @@ #ifndef _SLURM_PROTOCOL_API_H #define _SLURM_PROTOCOL_API_H -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> #include <sys/types.h> diff --git a/src/common/slurm_protocol_common.h b/src/common/slurm_protocol_common.h index 4c619291d486cce5af61ac0d42847b9ead935044..f99a04a1a1bc4fa3d2770ac271c2c762275bec9e 100644 --- a/src/common/slurm_protocol_common.h +++ b/src/common/slurm_protocol_common.h @@ -40,9 +40,7 @@ #ifndef _SLURM_PROTOCOL_COMMON_H #define _SLURM_PROTOCOL_COMMON_H -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <sys/time.h> #include <time.h> diff --git a/src/common/slurm_protocol_defs.c b/src/common/slurm_protocol_defs.c index 85a0b4b9cf4e096e3c9c07914ba5a4e8d566ef9a..5db869b7bc21156542434666b25e9977f9aad89b 100644 --- a/src/common/slurm_protocol_defs.c +++ b/src/common/slurm_protocol_defs.c @@ -40,16 +40,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" -#if HAVE_STDLIB_H -# include <stdlib.h> -#endif - -#include <stdio.h> #include <ctype.h> +#include <stdio.h> +#include <stdlib.h> #include "src/common/forward.h" #include "src/common/job_options.h" diff --git a/src/common/slurm_protocol_defs.h b/src/common/slurm_protocol_defs.h index 47dbc92aa15551db9237b184d8d88d05422ed119..be56733e80a4ba2d5d6b5a42b4864bd7496326f4 100644 --- a/src/common/slurm_protocol_defs.h +++ b/src/common/slurm_protocol_defs.h @@ -41,9 +41,7 @@ #ifndef _SLURM_PROTOCOL_DEFS_H #define _SLURM_PROTOCOL_DEFS_H -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> #include <sys/wait.h> diff --git a/src/common/slurm_protocol_interface.h b/src/common/slurm_protocol_interface.h index 244f71b8eb61679ca975facded74790d60b196e6..85e4fe0e718958c4fc4cf2298a112c29e093f3c3 100644 --- a/src/common/slurm_protocol_interface.h +++ b/src/common/slurm_protocol_interface.h @@ -39,9 +39,7 @@ #ifndef _SLURM_PROTOCOL_INTERFACE_H #define _SLURM_PROTOCOL_INTERFACE_H -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <fcntl.h> #include <inttypes.h> diff --git a/src/common/slurm_protocol_pack.c b/src/common/slurm_protocol_pack.c index bdb7d233f8daa54fe1af9caaa8f1ed574bb1e9a7..0322cc77c2dec7cb8b96a6b9080052c305c6c135 100644 --- a/src/common/slurm_protocol_pack.c +++ b/src/common/slurm_protocol_pack.c @@ -38,9 +38,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <errno.h> #include <stdio.h> diff --git a/src/common/slurm_protocol_pack.h b/src/common/slurm_protocol_pack.h index 012d38ff380db3fb68e1337812702efca3e3ed8e..eab68c217ce89b38203fe1bca7b5a4ec7b95d4ce 100644 --- a/src/common/slurm_protocol_pack.h +++ b/src/common/slurm_protocol_pack.h @@ -40,9 +40,7 @@ #ifndef _SLURM_PROTOCOL_PACK_H #define _SLURM_PROTOCOL_PACK_H -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> diff --git a/src/common/slurm_protocol_socket_common.h b/src/common/slurm_protocol_socket_common.h index b2b053baa2ec558c21c6d4669f5ad8f6b8c2efbd..3d0822f52e6cc750c1f633e8371f1ef25fa4a1d8 100644 --- a/src/common/slurm_protocol_socket_common.h +++ b/src/common/slurm_protocol_socket_common.h @@ -40,9 +40,7 @@ #ifndef _SLURM_PROTOCOL_SOCKET_COMMON_H #define _SLURM_PROTOCOL_SOCKET_COMMON_H -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> #include <netinet/in.h> diff --git a/src/common/slurm_protocol_socket_implementation.c b/src/common/slurm_protocol_socket_implementation.c index 442af4b00aeff70b882c1ee9d8f406b9913ed0bf..14d731b2046dc09313c2fa3260b8525bde1d9435 100644 --- a/src/common/slurm_protocol_socket_implementation.c +++ b/src/common/slurm_protocol_socket_implementation.c @@ -38,27 +38,24 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #define _USE_IRS 1 /* Required for AIX and hstrerror() */ -#include <unistd.h> -#include <string.h> -#include <netdb.h> +#include <arpa/inet.h> #include <errno.h> +#include <netdb.h> #include <netinet/in.h> #include <poll.h> -#include <sys/time.h> -#include <sys/types.h> #include <signal.h> -#include <stdio.h> #include <stdarg.h> +#include <stdio.h> #include <stdlib.h> -#include <arpa/inet.h> +#include <string.h> #include <sys/param.h> -#include <stdlib.h> +#include <sys/time.h> +#include <sys/types.h> +#include <unistd.h> #if HAVE_SYS_SOCKET_H # include <sys/socket.h> diff --git a/src/common/slurm_protocol_util.h b/src/common/slurm_protocol_util.h index f9df1d9d09c5579749610afbac2f0b5ea3a927b6..66b7ccec112925a6f82c31f240802c1bd860a652 100644 --- a/src/common/slurm_protocol_util.h +++ b/src/common/slurm_protocol_util.h @@ -39,9 +39,7 @@ #ifndef _SLURM_PROTOCOL_UTIL_H #define _SLURM_PROTOCOL_UTIL_H -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> #include <stdio.h> diff --git a/src/common/slurm_resource_info.c b/src/common/slurm_resource_info.c index 6ecb77f485147d2af021e22689d25e1423301f10..3709ffb0dda3ba0156b898a1de082acf46f9eb61 100644 --- a/src/common/slurm_resource_info.c +++ b/src/common/slurm_resource_info.c @@ -34,15 +34,11 @@ * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif -#if HAVE_STRING_H -# include <string.h> -#endif +#include "config.h" #include <ctype.h> +#include <string.h> #include <sys/types.h> #include "slurm/slurm.h" diff --git a/src/common/slurm_resource_info.h b/src/common/slurm_resource_info.h index 1a3981a433f88b5238494e12e071c420f0e04946..999879172335a223448e09ef79a5ec11fb185f47 100644 --- a/src/common/slurm_resource_info.h +++ b/src/common/slurm_resource_info.h @@ -38,9 +38,7 @@ #ifndef _RES_INFO_H #define _RES_INFO_H -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <stdint.h> diff --git a/src/common/slurm_step_layout.c b/src/common/slurm_step_layout.c index 0c4901d3daea3c9f12fed92608e89b28f048d886..08bfd5f65fe68e43ed0b42569c17daacb4300ae7 100644 --- a/src/common/slurm_step_layout.c +++ b/src/common/slurm_step_layout.c @@ -28,16 +28,10 @@ * Copyright (C) 2002 The Regents of the University of California. \*****************************************************************************/ -#ifdef HAVE_CONFIG_H -# include "config.h" -# if HAVE_STRING_H -# include <string.h> -# endif -#else /* !HAVE_CONFIG_H */ -# include <string.h> -#endif /* HAVE_CONFIG_H */ +#include "config.h" #include <stdlib.h> +#include <string.h> #include "slurm/slurm.h" #include "slurm/slurm_errno.h" diff --git a/src/common/slurm_step_layout.h b/src/common/slurm_step_layout.h index 27cd2fd4cb42c8750199b9854aedda1abb773847..d45002071ed5ea4e3b6ddafb64be6d85a65e075b 100644 --- a/src/common/slurm_step_layout.h +++ b/src/common/slurm_step_layout.h @@ -31,9 +31,7 @@ #ifndef _SLURM_STEP_LAYOUT_H #define _SLURM_STEP_LAYOUT_H -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> diff --git a/src/common/slurm_time.c b/src/common/slurm_time.c index 18919aa3efefc0c04641ab0fa2962204a5d326ed..1886125e5e671160c3ca4137c739725a2f49e8a8 100644 --- a/src/common/slurm_time.c +++ b/src/common/slurm_time.c @@ -36,9 +36,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <pthread.h> #include <time.h> diff --git a/src/common/slurm_xlator.h b/src/common/slurm_xlator.h index b92915acde02986458a1c1b4d5f0b8f6f06efdf1..58c9d5f94c941975945cdf2327571bac4a3f4fbf 100644 --- a/src/common/slurm_xlator.h +++ b/src/common/slurm_xlator.h @@ -66,9 +66,7 @@ #ifndef __SLURM_XLATOR_H__ #define __SLURM_XLATOR_H__ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #if USE_ALIAS diff --git a/src/common/slurmdbd_defs.c b/src/common/slurmdbd_defs.c index 7fad2c191f3af5e38904151e0f327ab4206042e4..48e3a1101f9b33ddb04d488c3b10d20dc34334b2 100644 --- a/src/common/slurmdbd_defs.c +++ b/src/common/slurmdbd_defs.c @@ -36,9 +36,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <arpa/inet.h> #include <fcntl.h> diff --git a/src/common/slurmdbd_defs.h b/src/common/slurmdbd_defs.h index 78f1be43f64823a2fdacb850ea13deecae95f302..ee2fdeac9bee287b784c883e04b1b2e30ea8b519 100644 --- a/src/common/slurmdbd_defs.h +++ b/src/common/slurmdbd_defs.h @@ -39,9 +39,7 @@ #ifndef _SLURMDBD_DEFS_H #define _SLURMDBD_DEFS_H -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> diff --git a/src/common/strlcpy.c b/src/common/strlcpy.c index 85c6bea06c99aa25f77bf81aa584ffbaa9d91bf2..12764c7e9f80a692f7973b70038e1c544bad6e53 100644 --- a/src/common/strlcpy.c +++ b/src/common/strlcpy.c @@ -16,12 +16,12 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#if HAVE_CONFIG_H -# include "config.h" -# if (!HAVE_STRLCPY) +#include "config.h" + +#if (!HAVE_STRLCPY) -#include <sys/types.h> #include <string.h> +#include <sys/types.h> #include "src/common/macros.h" #include "src/common/strlcpy.h" @@ -63,5 +63,4 @@ strlcpy(char *dst, const char *src, size_t siz) return(s - src - 1); /* count does not include NUL */ } -# endif /* !HAVE_STRLCPY */ -#endif /* HAVE_CONFIG_H */ +#endif /* !HAVE_STRLCPY */ diff --git a/src/common/strlcpy.h b/src/common/strlcpy.h index fe01a87d14a9c206c31d18a49b5b890b178dd632..b7eecda4d97926ffb8c9a34fb1ec5efb986df5de 100644 --- a/src/common/strlcpy.h +++ b/src/common/strlcpy.h @@ -1,19 +1,17 @@ #ifndef _STRLCPY_H #define _STRLCPY_H -#ifdef HAVE_CONFIG_H -# include "config.h" -# ifndef HAVE_STRLCPY +#ifndef HAVE_STRLCPY -# include <sys/types.h> +# include <sys/types.h> + + /* + * Copy src to string dst of size siz. At most siz-1 characters + * will be copied. Always NUL terminates (unless siz == 0). + * Returns strlen(src); if retval >= siz, truncation occurred. + */ + size_t strlcpy(char *dst, const char *src, size_t siz); - /* - * Copy src to string dst of size siz. At most siz-1 characters - * will be copied. Always NUL terminates (unless siz == 0). - * Returns strlen(src); if retval >= siz, truncation occurred. - */ - size_t strlcpy(char *dst, const char *src, size_t siz); # endif /* !HAVE_STRLCPY */ -#endif /* HAVE_CONFIG_H */ #endif /* _STRLCPY_H */ diff --git a/src/common/switch.h b/src/common/switch.h index b9d367b6e3745cc6111ee9f864c71d4dd29588d9..10b190a939463a129baa7820fcfe849775698f30 100644 --- a/src/common/switch.h +++ b/src/common/switch.h @@ -38,11 +38,9 @@ \*****************************************************************************/ #ifndef _SWITCH_H -#define _SWITCH_H 1 +#define _SWITCH_H -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <stdio.h> #include <sys/types.h> diff --git a/src/common/util-net.c b/src/common/util-net.c index e5346d20ef4747b131ba09cf73331ac0347c824b..c77ae96aed981064735f824434338da79d50221a 100644 --- a/src/common/util-net.c +++ b/src/common/util-net.c @@ -35,10 +35,7 @@ * Refer to "util-net.h" for documentation on public functions. \*****************************************************************************/ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif /* HAVE_CONFIG_H */ +#include "config.h" #ifndef _GNU_SOURCE # define _GNU_SOURCE diff --git a/src/common/util-net.h b/src/common/util-net.h index 66e1d7c3a3639557e6d27e1046c1da15de528b71..72f4a7eb76950395fe2a52c94c5ebcbf90a6f2f3 100644 --- a/src/common/util-net.h +++ b/src/common/util-net.h @@ -35,14 +35,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ - #ifndef _UTIL_NET_H #define _UTIL_NET_H - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif /* HAVE_CONFIG_H */ +#include "config.h" #ifndef _GNU_SOURCE # define _GNU_SOURCE diff --git a/src/common/xassert.c b/src/common/xassert.c index 75827a5f56aafce007f2906b67628e8548479606..2ca177427151003fe825efcf62297c9c48da17a1 100644 --- a/src/common/xassert.c +++ b/src/common/xassert.c @@ -37,12 +37,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" -#include <stdlib.h> #include <stdio.h> +#include <stdlib.h> #include "src/common/log.h" #include "src/common/macros.h" diff --git a/src/common/xassert.h b/src/common/xassert.h index 55e3b2c768cd24094ac68a60a3099218f4e9076f..4db7b15a72807e6123106fdced4bcd39f03e8747 100644 --- a/src/common/xassert.h +++ b/src/common/xassert.h @@ -41,9 +41,7 @@ #ifndef _XASSERT_H #define _XASSERT_H 1 -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include "macros.h" diff --git a/src/common/xcgroup_read_config.h b/src/common/xcgroup_read_config.h index 53cb3af9a8cb4b6e2383b8e3c610d444bb016227..89586c53df1e7f8a25917cd3f34bf726ca740c7d 100644 --- a/src/common/xcgroup_read_config.h +++ b/src/common/xcgroup_read_config.h @@ -37,9 +37,7 @@ #ifndef _CGROUP_READ_CONFIG_H #define _CGROUP_READ_CONFIG_H -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <inttypes.h> diff --git a/src/common/xmalloc.c b/src/common/xmalloc.c index 6367ec1305e47ab577ce3bd31c3d451e82829c2e..214f3799f15dfb98bed987bec9082b4fd5c50eeb 100644 --- a/src/common/xmalloc.c +++ b/src/common/xmalloc.c @@ -39,15 +39,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <errno.h> #include <pthread.h> #include <stdio.h> -#include <string.h> #include <stdlib.h> +#include <string.h> #include "src/common/log.h" #include "src/common/macros.h" diff --git a/src/common/xsignal.c b/src/common/xsignal.c index e40fa882d9abc2e915724bb112486200167c3990..b5270a7008a880edb746de6d0e0e764b49ae6d67 100644 --- a/src/common/xsignal.c +++ b/src/common/xsignal.c @@ -36,9 +36,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <errno.h> #include <signal.h> diff --git a/src/common/xstring.c b/src/common/xstring.c index 6c17cdd61ad80097131d21bdcc07d5007e88cb72..d32d2ae7d59fcfb4c51244e19b919123796ed93e 100644 --- a/src/common/xstring.c +++ b/src/common/xstring.c @@ -39,9 +39,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include <ctype.h> #include <errno.h>