[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Rationalize #includes - source compatibility?

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2004-11-13 21:13:07 CET

This is a source-compatibility question.

Wondering why my build was taking longer than it ought to, I noticed that we
quite often include headers that we don't need. I have just committed r11887
which removes some from source files. I want to follow up with this patch to
remove unused #includes from header files. If I do this, and a third-party
client's source code relied on the fact that some of our headers unnecessarily
include other headers, then his source code will not compile straight away
after this change. I think we can agree that such code is broken, but,
regardless of that, do we feel we need to provide source-level compatibility
with such code? If so then I will patch only the private headers.

- Julian

Rationalize #includes in C header files.

Remove each #include that is neither directly used nor provided on
purpose for convenience. Include a lower-level header instead where
necessary.

Index: subversion/include/svn_error_codes.h
===================================================================
--- subversion/include/svn_error_codes.h (revision 11885)
+++ subversion/include/svn_error_codes.h (working copy)
@@ -42,11 +42,8 @@
 #if defined(SVN_ERROR_BUILD_ARRAY) || !defined(SVN_ERROR_ENUM_DEFINED)
 
 
-#include <apr.h>
 #include <apr_errno.h> /* APR's error system */
 
-#include "svn_props.h" /* For SVN_PROP_EXTERNALS. */
-
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
Index: subversion/include/svn_diff.h
===================================================================
--- subversion/include/svn_diff.h (revision 11885)
+++ subversion/include/svn_diff.h (working copy)
@@ -48,7 +48,6 @@
 #include <apr_file_io.h>
 
 #include "svn_types.h"
-#include "svn_error.h"
 #include "svn_io.h"
 #include "svn_version.h"
 
Index: subversion/include/svn_test.h
===================================================================
--- subversion/include/svn_test.h (revision 11885)
+++ subversion/include/svn_test.h (working copy)
@@ -24,10 +24,7 @@
 
 #include <apr_pools.h>
 #include "svn_delta.h"
-#include "svn_path.h"
 #include "svn_types.h"
-#include "svn_error.h"
-#include "svn_string.h"
 
 
 #ifdef __cplusplus
Index: subversion/include/svn_path.h
===================================================================
--- subversion/include/svn_path.h (revision 11885)
+++ subversion/include/svn_path.h (working copy)
@@ -39,7 +39,6 @@
 #include <apr_tables.h>
 
 #include "svn_string.h"
-#include "svn_error.h"
 
 
 #ifdef __cplusplus
Index: subversion/include/svn_xml.h
===================================================================
--- subversion/include/svn_xml.h (revision 11885)
+++ subversion/include/svn_xml.h (working copy)
@@ -28,7 +28,6 @@
 #include <apr_pools.h>
 #include <apr_hash.h>
 
-#include "svn_error.h"
 #include "svn_string.h"
 
 #ifdef __cplusplus
Index: subversion/include/svn_config.h
===================================================================
--- subversion/include/svn_config.h (revision 11885)
+++ subversion/include/svn_config.h (working copy)
@@ -27,7 +27,6 @@
 #include <apr_pools.h>
 
 #include "svn_types.h"
-#include "svn_error.h"
 
 
 #ifdef __cplusplus
Index: subversion/include/svn_hash.h
===================================================================
--- subversion/include/svn_hash.h (revision 11885)
+++ subversion/include/svn_hash.h (working copy)
@@ -29,7 +29,6 @@
 
 #include "svn_types.h"
 #include "svn_io.h"
-#include "svn_error.h"
 
 
 #ifdef __cplusplus
Index: subversion/include/svn_md5.h
===================================================================
--- subversion/include/svn_md5.h (revision 11885)
+++ subversion/include/svn_md5.h (working copy)
@@ -24,8 +24,7 @@
 
 #include <apr_pools.h>
 #include <apr_md5.h>
-#include "svn_error.h"
-#include "svn_pools.h"
+#include "svn_types.h"
 
 #ifdef __cplusplus
 extern "C" {
Index: subversion/include/svn_pools.h
===================================================================
--- subversion/include/svn_pools.h (revision 11885)
+++ subversion/include/svn_pools.h (working copy)
@@ -29,8 +29,6 @@
 #include <apr_errno.h> /* APR's error system */
 #include <apr_pools.h>
 
-#include "svn_types.h"
-
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
Index: subversion/include/svn_utf.h
===================================================================
--- subversion/include/svn_utf.h (revision 11885)
+++ subversion/include/svn_utf.h (working copy)
@@ -26,7 +26,6 @@
 
 #include <apr_xlate.h>
 
-#include "svn_error.h"
 #include "svn_string.h"
 
 #ifdef __cplusplus
Index: subversion/include/svn_time.h
===================================================================
--- subversion/include/svn_time.h (revision 11885)
+++ subversion/include/svn_time.h (working copy)
@@ -25,7 +25,7 @@
 #include <apr_pools.h>
 #include <apr_time.h>
 
-#include "svn_error.h"
+#include "svn_types.h"
 
 #ifdef __cplusplus
 extern "C" {
Index: subversion/libsvn_diff/diff.h
===================================================================
--- subversion/libsvn_diff/diff.h (revision 11885)
+++ subversion/libsvn_diff/diff.h (working copy)
@@ -23,8 +23,6 @@
 #include <apr_pools.h>
 #include <apr_general.h>
 
-#include "svn_pools.h"
-#include "svn_error.h"
 #include "svn_diff.h"
 #include "svn_types.h"
 
Index: subversion/libsvn_wc/questions.h
===================================================================
--- subversion/libsvn_wc/questions.h (revision 11885)
+++ subversion/libsvn_wc/questions.h (working copy)
@@ -22,7 +22,6 @@
 
 #include <apr_pools.h>
 #include "svn_types.h"
-#include "svn_string.h"
 #include "svn_error.h"
 
 #ifdef __cplusplus
Index: subversion/libsvn_wc/translate.h
===================================================================
--- subversion/libsvn_wc/translate.h (revision 11885)
+++ subversion/libsvn_wc/translate.h (working copy)
@@ -22,8 +22,6 @@
 
 #include <apr_pools.h>
 #include "svn_types.h"
-#include "svn_string.h"
-#include "svn_error.h"
 #include "svn_subst.h"
 
 #ifdef __cplusplus
Index: subversion/libsvn_wc/props.h
===================================================================
--- subversion/libsvn_wc/props.h (revision 11885)
+++ subversion/libsvn_wc/props.h (working copy)
@@ -23,7 +23,7 @@
 #include <apr_pools.h>
 #include "svn_types.h"
 #include "svn_string.h"
-#include "svn_error.h"
+#include "svn_props.h"
 
 
 #ifdef __cplusplus
Index: subversion/libsvn_wc/entries.h
===================================================================
--- subversion/libsvn_wc/entries.h (revision 11885)
+++ subversion/libsvn_wc/entries.h (working copy)
@@ -22,8 +22,6 @@
 
 #include <apr_pools.h>
 #include "svn_types.h"
-#include "svn_string.h"
-#include "svn_error.h"
 
 #ifdef __cplusplus
 extern "C" {
Index: subversion/libsvn_wc/adm_ops.h
===================================================================
--- subversion/libsvn_wc/adm_ops.h (revision 11885)
+++ subversion/libsvn_wc/adm_ops.h (working copy)
@@ -26,8 +26,6 @@
 
 #include <apr_pools.h>
 #include "svn_types.h"
-#include "svn_string.h"
-#include "svn_error.h"
 
 #ifdef __cplusplus
 extern "C" {
Index: subversion/libsvn_wc/adm_files.h
===================================================================
--- subversion/libsvn_wc/adm_files.h (revision 11885)
+++ subversion/libsvn_wc/adm_files.h (working copy)
@@ -25,8 +25,6 @@
 
 #include <apr_pools.h>
 #include "svn_types.h"
-#include "svn_string.h"
-#include "svn_error.h"
 
 #ifdef __cplusplus
 extern "C" {
Index: subversion/libsvn_subr/utf_impl.h
===================================================================
--- subversion/libsvn_subr/utf_impl.h (revision 11885)
+++ subversion/libsvn_subr/utf_impl.h (working copy)
@@ -22,8 +22,8 @@
 #define SVN_LIBSVN_SUBR_UTF_IMPL_H
 
 
-#include "svn_error.h"
-#include "svn_pools.h"
+#include <apr_pools.h>
+#include "svn_types.h"
 
 #ifdef __cplusplus
 extern "C" {
Index: subversion/libsvn_subr/config_impl.h
===================================================================
--- subversion/libsvn_subr/config_impl.h (revision 11885)
+++ subversion/libsvn_subr/config_impl.h (working copy)
@@ -26,7 +26,6 @@
 
 #include <apr_hash.h>
 #include "svn_types.h"
-#include "svn_pools.h"
 #include "svn_string.h"
 #include "svn_config.h"
 #include "svn_private_config.h"
Index: subversion/libsvn_ra_local/ra_local.h
===================================================================
--- subversion/libsvn_ra_local/ra_local.h (revision 11885)
+++ subversion/libsvn_ra_local/ra_local.h (working copy)
@@ -22,10 +22,7 @@
 #include <apr_pools.h>
 #include <apr_tables.h>
 
-#include "svn_error.h"
-#include "svn_string.h"
-#include "svn_path.h"
-#include "svn_delta.h"
+#include "svn_types.h"
 #include "svn_fs.h"
 #include "svn_repos.h"
 #include "svn_ra.h"
Index: subversion/libsvn_delta/delta.h
===================================================================
--- subversion/libsvn_delta/delta.h (revision 11885)
+++ subversion/libsvn_delta/delta.h (working copy)
@@ -22,7 +22,6 @@
 #include <apr_pools.h>
 #include <apr_hash.h>
 
-#include "svn_xml.h"
 #include "svn_delta.h"
 
 #ifndef SVN_LIBSVN_DELTA_H
Index: subversion/libsvn_ra_dav/ra_dav.h
===================================================================
--- subversion/libsvn_ra_dav/ra_dav.h (revision 11885)
+++ subversion/libsvn_ra_dav/ra_dav.h (working copy)
@@ -31,7 +31,6 @@
 
 #include "svn_types.h"
 #include "svn_string.h"
-#include "svn_error.h"
 #include "svn_delta.h"
 #include "svn_ra.h"
 #include "svn_dav.h"

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Nov 13 21:13:35 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.