sal/IwyuFilter_sal.yaml                          |    3 +++
 sal/inc/oslmemory.h                              |    1 -
 sal/inc/oslrandom.h                              |    2 ++
 sal/inc/uri_internal.hxx                         |    3 +++
 sal/osl/unx/file.cxx                             |    2 ++
 sal/osl/unx/file_error_transl.hxx                |    1 -
 sal/osl/unx/file_impl.hxx                        |    1 -
 sal/osl/unx/file_path_helper.cxx                 |    1 +
 sal/osl/unx/file_path_helper.hxx                 |    1 -
 sal/osl/unx/file_stat.cxx                        |    1 +
 sal/osl/unx/process_impl.cxx                     |    1 +
 sal/osl/unx/secimpl.hxx                          |    2 ++
 sal/osl/unx/sockimpl.hxx                         |    5 +----
 sal/osl/unx/uunxapi.cxx                          |    2 ++
 sal/osl/unx/uunxapi.hxx                          |    4 ----
 sal/osl/w32/path_helper.hxx                      |    2 --
 sal/osl/w32/thread.hxx                           |    2 --
 sal/qa/inc/valueequal.hxx                        |    2 ++
 sal/rtl/alloc_arena.cxx                          |    4 ++++
 sal/rtl/alloc_impl.hxx                           |    1 -
 sal/rtl/strimp.cxx                               |    1 +
 sal/rtl/strimp.hxx                               |    4 ++--
 sal/textenc/handleundefinedunicodetotextchar.cxx |    1 +
 sal/textenc/tables.cxx                           |    1 +
 sal/textenc/tenchelp.hxx                         |    2 --
 sal/textenc/textenc.cxx                          |    1 +
 sal/textenc/unichars.hxx                         |    3 ---
 27 files changed, 30 insertions(+), 24 deletions(-)

New commits:
commit 10a87728636492afc48bbb8eee7d49f3f653293e
Author:     Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>
AuthorDate: Thu Aug 10 10:01:03 2023 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Mon Aug 14 09:10:29 2023 +0200

    tdf#146619 Remove unused includes from sal/ [headers]
    
    Change-Id: I8fae71e5053950441a2e0920590264c2cb858924
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155546
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sal/IwyuFilter_sal.yaml b/sal/IwyuFilter_sal.yaml
index 325aba8552c4..b3b5cfded82e 100644
--- a/sal/IwyuFilter_sal.yaml
+++ b/sal/IwyuFilter_sal.yaml
@@ -4,6 +4,9 @@ excludelist:
     sal/osl/all/log.cxx:
     #sal_use_syslog required from this file
     - salusesyslog.hxx
+    sal/osl/unx/backtrace.h:
+    # needed for the "shadow" backtrace API
+    - execinfo.h
     sal/osl/unx/system.hxx:
     # needed for the define  pthread_testcancel() to work
     - pthread.h
diff --git a/sal/inc/oslmemory.h b/sal/inc/oslmemory.h
index de99e9851e80..fa102d6b02f6 100644
--- a/sal/inc/oslmemory.h
+++ b/sal/inc/oslmemory.h
@@ -10,7 +10,6 @@
 #ifndef INCLUDED_SAL_INC_INTERNAL_OSLMEMORY_H
 #define INCLUDED_SAL_INC_INTERNAL_OSLMEMORY_H
 
-#include <sal/saldllapi.h>
 #include <sal/types.h>
 
 #if defined __cplusplus
diff --git a/sal/inc/oslrandom.h b/sal/inc/oslrandom.h
index 305eaf937b65..8f5dfffae426 100644
--- a/sal/inc/oslrandom.h
+++ b/sal/inc/oslrandom.h
@@ -10,6 +10,8 @@
 #ifndef INCLUDED_SAL_INC_INTERNAL_OSLRANDOM_H
 #define INCLUDED_SAL_INC_INTERNAL_OSLRANDOM_H
 
+#include <stddef.h>
+
 #if defined __cplusplus
 extern "C" {
 #endif
diff --git a/sal/inc/uri_internal.hxx b/sal/inc/uri_internal.hxx
index 071511e776ee..dd64a524100a 100644
--- a/sal/inc/uri_internal.hxx
+++ b/sal/inc/uri_internal.hxx
@@ -21,6 +21,9 @@
 
 #include <sal/config.h>
 
+#include <sal/types.h>
+#include <rtl/textenc.h>
+
 namespace rtl::uri::detail
 {
 enum EscapeType
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 3bdb4a50b05a..4b1313586e81 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -48,6 +48,8 @@
 #include <pthread.h>
 #include <sys/file.h>
 #include <sys/mman.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
 #if defined(MACOSX)
 
diff --git a/sal/osl/unx/file_error_transl.hxx 
b/sal/osl/unx/file_error_transl.hxx
index 81d972032346..67e6b5459046 100644
--- a/sal/osl/unx/file_error_transl.hxx
+++ b/sal/osl/unx/file_error_transl.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_SAL_OSL_UNX_FILE_ERROR_TRANSL_HXX
 
 #include <osl/file.h>
-#include <sal/types.h>
 
 /** Translate errno's to osl file errors
 
diff --git a/sal/osl/unx/file_impl.hxx b/sal/osl/unx/file_impl.hxx
index 2b374cb68ac0..4a9a90d4160f 100644
--- a/sal/osl/unx/file_impl.hxx
+++ b/sal/osl/unx/file_impl.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_SAL_OSL_UNX_FILE_IMPL_HXX
 
 #include <osl/file.h>
-#include <stddef.h>
 #include <sys/types.h>
 #include <rtl/string.hxx>
 
diff --git a/sal/osl/unx/file_path_helper.cxx b/sal/osl/unx/file_path_helper.cxx
index a8ee5238f95a..472ab880af93 100644
--- a/sal/osl/unx/file_path_helper.cxx
+++ b/sal/osl/unx/file_path_helper.cxx
@@ -21,6 +21,7 @@
 
 #include <cassert>
 #include <utility>
+#include <unistd.h>
 
 #include "file_path_helper.hxx"
 #include "uunxapi.hxx"
diff --git a/sal/osl/unx/file_path_helper.hxx b/sal/osl/unx/file_path_helper.hxx
index e210b27a3866..cbafb7482cba 100644
--- a/sal/osl/unx/file_path_helper.hxx
+++ b/sal/osl/unx/file_path_helper.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_SAL_OSL_UNX_FILE_PATH_HELPER_HXX
 #define INCLUDED_SAL_OSL_UNX_FILE_PATH_HELPER_HXX
 
-#include <sal/types.h>
 #include <rtl/ustring.h>
 #include <rtl/ustring.hxx>
 
diff --git a/sal/osl/unx/file_stat.cxx b/sal/osl/unx/file_stat.cxx
index f19b177fff23..fe56386d8719 100644
--- a/sal/osl/unx/file_stat.cxx
+++ b/sal/osl/unx/file_stat.cxx
@@ -20,6 +20,7 @@
 #include <osl/file.h>
 
 #include "system.hxx"
+#include <sys/stat.h>
 #include <sys/types.h>
 #include <dirent.h>
 #include <errno.h>
diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx
index a61df87c2cff..576b50486119 100644
--- a/sal/osl/unx/process_impl.cxx
+++ b/sal/osl/unx/process_impl.cxx
@@ -25,6 +25,7 @@
 #include <pthread.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
 #include <osl/diagnose.h>
 #include <osl/file.hxx>
diff --git a/sal/osl/unx/secimpl.hxx b/sal/osl/unx/secimpl.hxx
index 1577d6609bc7..165efafaa1bb 100644
--- a/sal/osl/unx/secimpl.hxx
+++ b/sal/osl/unx/secimpl.hxx
@@ -20,6 +20,8 @@
 #ifndef INCLUDED_SAL_OSL_UNX_SECIMPL_HXX
 #define INCLUDED_SAL_OSL_UNX_SECIMPL_HXX
 
+#include <osl/security.h>
+
 #include <pwd.h>
 
 struct oslSecurityImpl
diff --git a/sal/osl/unx/sockimpl.hxx b/sal/osl/unx/sockimpl.hxx
index 4a67df4f1f72..dc354db94a42 100644
--- a/sal/osl/unx/sockimpl.hxx
+++ b/sal/osl/unx/sockimpl.hxx
@@ -20,12 +20,9 @@
 #ifndef INCLUDED_SAL_OSL_UNX_SOCKIMPL_HXX
 #define INCLUDED_SAL_OSL_UNX_SOCKIMPL_HXX
 
-#include <osl/pipe.h>
-#include <osl/socket.h>
 #include <osl/interlck.h>
 
-#include "system.hxx"
-
+#include <sys/socket.h>
 #include <sys/un.h>
 
 #if defined(LINUX) || defined(FREEBSD) || defined(NETBSD)
diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx
index bdfed5d1ebad..fca0c179e9e7 100644
--- a/sal/osl/unx/uunxapi.cxx
+++ b/sal/osl/unx/uunxapi.cxx
@@ -32,6 +32,8 @@
 #include <sal/log.hxx>
 
 #include <sys/file.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #include <utime.h>
 
 #ifdef ANDROID
diff --git a/sal/osl/unx/uunxapi.hxx b/sal/osl/unx/uunxapi.hxx
index 9f792765c582..d4b73a7fbdbd 100644
--- a/sal/osl/unx/uunxapi.hxx
+++ b/sal/osl/unx/uunxapi.hxx
@@ -24,11 +24,7 @@
 
 #include <string_view>
 
-#include <unistd.h>
-#include <stdlib.h>
 #include <sys/types.h>
-#include <sys/stat.h>
-#include <rtl/ustring.h>
 
 #include <rtl/ustring.hxx>
 
diff --git a/sal/osl/w32/path_helper.hxx b/sal/osl/w32/path_helper.hxx
index bcb4f83af701..beda51992058 100644
--- a/sal/osl/w32/path_helper.hxx
+++ b/sal/osl/w32/path_helper.hxx
@@ -23,8 +23,6 @@
 #include <sal/config.h>
 
 #include <osl/diagnose.h>
-#include <osl/file.h>
-#include <rtl/alloc.h>
 #include <rtl/ustring.h>
 #include <rtl/ustring.hxx>
 #include <sal/types.h>
diff --git a/sal/osl/w32/thread.hxx b/sal/osl/w32/thread.hxx
index 8002d8b7f855..e82ccbcf6135 100644
--- a/sal/osl/w32/thread.hxx
+++ b/sal/osl/w32/thread.hxx
@@ -11,8 +11,6 @@
 
 #include <sal/config.h>
 
-#include <sal/types.h>
-
 void osl_callThreadKeyCallbackOnThreadDetach(void);
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sal/qa/inc/valueequal.hxx b/sal/qa/inc/valueequal.hxx
index 5e6d47d30f7a..1ac88ce2e44f 100644
--- a/sal/qa/inc/valueequal.hxx
+++ b/sal/qa/inc/valueequal.hxx
@@ -23,6 +23,8 @@
 #include <sal/config.h>
 
 #include <cmath>
+#include <stdio.h>
+#include <sal/types.h>
 
 #define PREC_float 1
 #define PREC_double 2
diff --git a/sal/rtl/alloc_arena.cxx b/sal/rtl/alloc_arena.cxx
index f126efdabd27..47cb3eeab6cb 100644
--- a/sal/rtl/alloc_arena.cxx
+++ b/sal/rtl/alloc_arena.cxx
@@ -29,6 +29,10 @@
 #include <string.h>
 #include <stdio.h>
 
+#if defined(SAL_UNX)
+#include <unistd.h>
+#endif /* SAL_UNX */
+
 namespace {
 
 /**
diff --git a/sal/rtl/alloc_impl.hxx b/sal/rtl/alloc_impl.hxx
index 29c24cc998d7..398597c483d7 100644
--- a/sal/rtl/alloc_impl.hxx
+++ b/sal/rtl/alloc_impl.hxx
@@ -181,7 +181,6 @@ static inline unsigned int lowbit(sal_Size n)
 
 #if defined(SAL_UNX)
 
-#include <unistd.h>
 #include <pthread.h>
 
 typedef pthread_mutex_t rtl_memory_lock_type;
diff --git a/sal/rtl/strimp.cxx b/sal/rtl/strimp.cxx
index 44b56023d0d4..6e3d6f3d54b5 100644
--- a/sal/rtl/strimp.cxx
+++ b/sal/rtl/strimp.cxx
@@ -19,6 +19,7 @@
 #include <sal/config.h>
 
 #include <assert.h>
+#include <stdlib.h>
 #include <rtl/alloc.h>
 #include <rtl/ustring.h>
 #include <rtllifecycle.h>
diff --git a/sal/rtl/strimp.hxx b/sal/rtl/strimp.hxx
index 69404e0aa390..5fd759313ed3 100644
--- a/sal/rtl/strimp.hxx
+++ b/sal/rtl/strimp.hxx
@@ -26,8 +26,8 @@
 #endif
 
 #include <sal/types.h>
-#include <rtl/string.hxx>
-#include <rtl/ustring.hxx>
+#include <rtl/string.h>
+#include <rtl/ustring.h>
 
 /* ======================================================================= */
 /* Help functions for String and UString                                   */
diff --git a/sal/textenc/handleundefinedunicodetotextchar.cxx 
b/sal/textenc/handleundefinedunicodetotextchar.cxx
index 76aed03e1881..78b2464b70c6 100644
--- a/sal/textenc/handleundefinedunicodetotextchar.cxx
+++ b/sal/textenc/handleundefinedunicodetotextchar.cxx
@@ -9,6 +9,7 @@
 
 #include <sal/config.h>
 
+#include <rtl/character.hxx>
 #include <rtl/textcvt.h>
 #include <sal/types.h>
 
diff --git a/sal/textenc/tables.cxx b/sal/textenc/tables.cxx
index 163ffe131de4..60f4323beade 100644
--- a/sal/textenc/tables.cxx
+++ b/sal/textenc/tables.cxx
@@ -26,6 +26,7 @@
 #include <iterator>
 
 #include <rtl/textenc.h>
+#include <rtl/tencinfo.h>
 #include <sal/types.h>
 
 #define NOTABUNI_START 0xFF
diff --git a/sal/textenc/tenchelp.hxx b/sal/textenc/tenchelp.hxx
index 469ffabb7acf..983b07669b20 100644
--- a/sal/textenc/tenchelp.hxx
+++ b/sal/textenc/tenchelp.hxx
@@ -22,9 +22,7 @@
 
 #include <sal/config.h>
 
-#include <rtl/tencinfo.h>
 #include <rtl/textcvt.h>
-#include <rtl/textenc.h>
 #include <sal/types.h>
 
 #include "unichars.hxx"
diff --git a/sal/textenc/textenc.cxx b/sal/textenc/textenc.cxx
index 5765637fddac..b8b12fb21bf7 100644
--- a/sal/textenc/textenc.cxx
+++ b/sal/textenc/textenc.cxx
@@ -28,6 +28,7 @@
 
 #include <osl/module.hxx>
 #include <rtl/textenc.h>
+#include <rtl/tencinfo.h>
 #include <rtl/ustring.h>
 #include <rtl/ustring.hxx>
 #include <sal/log.hxx>
diff --git a/sal/textenc/unichars.hxx b/sal/textenc/unichars.hxx
index e627d3c95c3e..874abdb4b42e 100644
--- a/sal/textenc/unichars.hxx
+++ b/sal/textenc/unichars.hxx
@@ -22,9 +22,6 @@
 
 #include <sal/config.h>
 
-#include <cassert>
-
-#include <rtl/character.hxx>
 #include <sal/types.h>
 
 #define RTL_TEXTENC_UNICODE_REPLACEMENT_CHARACTER 0xFFFD

Reply via email to