[asterisk-commits] Build System: Support include-what-you-use. (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 3 05:52:19 CST 2015


Joshua Colp has submitted this change and it was merged.

Change subject: Build System: Support include-what-you-use.
......................................................................


Build System: Support include-what-you-use.

ASTERISK-25591 #close

Change-Id: I8d3efa0826142ece9cbed2fd0d46f3b607fee6ae
---
M configure
M configure.ac
M include/asterisk/astmm.h
M include/asterisk/autoconfig.h.in
M include/asterisk/compat.h
5 files changed, 18 insertions(+), 20 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/configure b/configure
index 509e29f..bc51839 100755
--- a/configure
+++ b/configure
@@ -13653,7 +13653,7 @@
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -13699,7 +13699,7 @@
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -13723,7 +13723,7 @@
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -13768,7 +13768,7 @@
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -13792,7 +13792,7 @@
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
diff --git a/configure.ac b/configure.ac
index 7f69430..021d0d1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -218,17 +218,13 @@
 fi
 AC_SUBST(PBX_OSREV)
 
-AH_TOP(
-#ifndef ASTERISK_AUTOCONFIG_H
+AH_TOP([#ifndef ASTERISK_AUTOCONFIG_H
 #define ASTERISK_AUTOCONFIG_H
+/* IWYU pragma: private, include "asterisk.h" */
 
-#include "asterisk/buildopts.h"
+#include "asterisk/buildopts.h" /* IWYU pragma: export */])
 
-)
-
-AH_BOTTOM(
-#endif
-)
+AH_BOTTOM([#endif	/* ASTERISK_AUTOCONFIG_H */])
 
 # cross-compile checks
 if test "${cross_compiling}" = "yes";
diff --git a/include/asterisk/astmm.h b/include/asterisk/astmm.h
index 6c9a8ae..83c34be 100644
--- a/include/asterisk/astmm.h
+++ b/include/asterisk/astmm.h
@@ -30,6 +30,7 @@
 
 #ifndef _ASTERISK_ASTMM_H
 #define _ASTERISK_ASTMM_H
+/* IWYU pragma: private, include "asterisk/utils.h" */
 
 #ifndef STANDALONE
 
diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in
index 17aac1d..d86ba4a 100644
--- a/include/asterisk/autoconfig.h.in
+++ b/include/asterisk/autoconfig.h.in
@@ -2,10 +2,9 @@
 
 #ifndef ASTERISK_AUTOCONFIG_H
 #define ASTERISK_AUTOCONFIG_H
+/* IWYU pragma: private, include "asterisk.h" */
 
-#include "asterisk/buildopts.h"
-
-
+#include "asterisk/buildopts.h" /* IWYU pragma: export */
 
 /* Define to 1 if internal poll should be used. */
 #undef AST_POLL_COMPAT
@@ -1381,4 +1380,4 @@
    code using `volatile' can become incorrect without. Disable with care. */
 #undef volatile
 
-#endif
+#endif	/* ASTERISK_AUTOCONFIG_H */
diff --git a/include/asterisk/compat.h b/include/asterisk/compat.h
index c9c99c1..3eb6c96 100644
--- a/include/asterisk/compat.h
+++ b/include/asterisk/compat.h
@@ -15,10 +15,12 @@
  * especially those related to header files.
  */
 
-#include "asterisk/compiler.h"
-
 #ifndef _COMPAT_H
 #define _COMPAT_H
+/* IWYU pragma: private, include "asterisk.h" */
+/* IWYU pragma: begin_exports */
+
+#include "asterisk/compiler.h"
 
 #ifndef __STDC_VERSION__
 /* flex output wants to find this defined. */
@@ -231,5 +233,5 @@
 #ifndef NAN
 #define NAN (0.0/0.0)
 #endif
-
+/* IWYU pragma: end_exports */
 #endif

-- 
To view, visit https://gerrit.asterisk.org/1717
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8d3efa0826142ece9cbed2fd0d46f3b607fee6ae
Gerrit-PatchSet: 5
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-commits mailing list