From e131fde62b222aa51bd4e58df507204fc039a899 Mon Sep 17 00:00:00 2001
From: Su_Laus <[EMAIL REDACTED]>
Date: Mon, 26 Dec 2022 17:39:48 +0100
Subject: [PATCH 1/2] Disable clang-formatting for tif_config.h.cmake.in and
tiffconf.h.cmake.in because sensitive for CMake scripts.
---
.pre-commit-config.yaml | 11 ++++++++++-
libtiff/tif_config.h.cmake.in | 7 +++++++
libtiff/tif_config.h.in | 7 +++++++
libtiff/tiffconf.h.cmake.in | 7 +++++++
libtiff/tiffconf.h.in | 7 +++++++
5 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index dbad088d..9b3e0e0c 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -6,8 +6,17 @@ repos:
# tif_fax3sm.c is a generated file
# tiffvers.h as well, and its formatting is sensitive for
# FindTIFF.cmake to detect the version number
+ # Furthermore, the .in files are formatting sensitive for
+ # cmake functions.
exclude: >
(?x)^(
libtiff/tif_fax3sm.c|
- libtiff/tiffvers.h
+ libtiff/tiffvers.h|
+ libtiff/tiffvers.h.in|
+ libtiff/tif_config.h|
+ libtiff/tif_config.h.in|
+ libtiff/tif_config.h.cmake.in|
+ libtiff/tiffconf.h|
+ libtiff/tiffconf.h.in|
+ libtiff/tiffconf.h.cmake.in
)
diff --git a/libtiff/tif_config.h.cmake.in b/libtiff/tif_config.h.cmake.in
index 570e4e1b..b56f01ee 100644
--- a/libtiff/tif_config.h.cmake.in
+++ b/libtiff/tif_config.h.cmake.in
@@ -1,3 +1,8 @@
+/* clang-format off */
+/* clang-format disabled because CMake scripts are very sensitive to the
+ * formatting of this file.
+ */
+
/* libtiff/tif_config.h.cmake.in. Not generated, but originated from autoheader. */
/* This file must be kept up-to-date with needed substitutions from libtiff/tif_config.h.in. */
@@ -156,3 +161,5 @@
#else
# error "Unsupported size_t size; please submit a bug report"
#endif
+
+/* clang-format on */
diff --git a/libtiff/tif_config.h.in b/libtiff/tif_config.h.in
index 8fb78c38..9f519851 100644
--- a/libtiff/tif_config.h.in
+++ b/libtiff/tif_config.h.in
@@ -1,3 +1,8 @@
+/* clang-format off */
+/* clang-format disabled because CMake scripts are very sensitive to the
+ * formatting of this file.
+ */
+
/* libtiff/tif_config.h.in. Not generated, but originated from autoheader. */
#include "tiffconf.h"
@@ -172,3 +177,5 @@
#else
# error "Unsupported size_t size; please submit a bug report"
#endif
+
+/* clang-format on */
diff --git a/libtiff/tiffconf.h.cmake.in b/libtiff/tiffconf.h.cmake.in
index 5afbf3b2..9cd6b746 100644
--- a/libtiff/tiffconf.h.cmake.in
+++ b/libtiff/tiffconf.h.cmake.in
@@ -4,6 +4,11 @@
from this file in your programs.
*/
+/* clang-format off */
+/* clang-format disabled because CMake scripts are very sensitive to the
+ * formatting of this file.
+ */
+
#ifndef _TIFFCONF_
#define _TIFFCONF_
@@ -125,3 +130,5 @@
#define IPTC_SUPPORT
#endif /* _TIFFCONF_ */
+
+/* clang-format on */
diff --git a/libtiff/tiffconf.h.in b/libtiff/tiffconf.h.in
index 6703eb0e..7c9559da 100644
--- a/libtiff/tiffconf.h.in
+++ b/libtiff/tiffconf.h.in
@@ -4,6 +4,11 @@
from this file in your programs.
*/
+/* clang-format off */
+/* clang-format disabled because CMake scripts are very sensitive to the
+ * formatting of this file.
+ */
+
#ifndef _TIFFCONF_
#define _TIFFCONF_
@@ -125,3 +130,5 @@
#define IPTC_SUPPORT
#endif /* _TIFFCONF_ */
+
+/* clang-format on */
From bdaf7c7f4f1d15477d402b3d6bc8f2d96a2cb1ee Mon Sep 17 00:00:00 2001
From: Su_Laus <sulau@freenet.de>
Date: Wed, 28 Dec 2022 20:21:22 +0100
Subject: [PATCH 2/2] Disable clang-formatting for tif_config.h.cmake.in and
tiffconf.h.cmake.in because sensitive for CMake scripts. - explanation added
---
libtiff/tif_config.h.cmake.in | 3 ++-
libtiff/tif_config.h.in | 3 ++-
libtiff/tiffconf.h.cmake.in | 3 ++-
libtiff/tiffconf.h.in | 3 ++-
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/libtiff/tif_config.h.cmake.in b/libtiff/tif_config.h.cmake.in
index b56f01ee..1547af46 100644
--- a/libtiff/tif_config.h.cmake.in
+++ b/libtiff/tif_config.h.cmake.in
@@ -1,6 +1,7 @@
/* clang-format off */
/* clang-format disabled because CMake scripts are very sensitive to the
- * formatting of this file.
+ * formatting of this file. configure_file variables of type "@VAR@" are
+ * modified by clang-format and won't be substituted.
*/
/* libtiff/tif_config.h.cmake.in. Not generated, but originated from autoheader. */
diff --git a/libtiff/tif_config.h.in b/libtiff/tif_config.h.in
index 9f519851..87c08bb7 100644
--- a/libtiff/tif_config.h.in
+++ b/libtiff/tif_config.h.in
@@ -1,6 +1,7 @@
/* clang-format off */
/* clang-format disabled because CMake scripts are very sensitive to the
- * formatting of this file.
+ * formatting of this file. configure_file variables of type "@VAR@" are
+ * modified by clang-format and won't be substituted.
*/
/* libtiff/tif_config.h.in. Not generated, but originated from autoheader. */
diff --git a/libtiff/tiffconf.h.cmake.in b/libtiff/tiffconf.h.cmake.in
index 9cd6b746..e3a830d4 100644
--- a/libtiff/tiffconf.h.cmake.in
+++ b/libtiff/tiffconf.h.cmake.in
@@ -6,7 +6,8 @@
/* clang-format off */
/* clang-format disabled because CMake scripts are very sensitive to the
- * formatting of this file.
+ * formatting of this file. configure_file variables of type "@VAR@" are
+ * modified by clang-format and won't be substituted.
*/
#ifndef _TIFFCONF_
diff --git a/libtiff/tiffconf.h.in b/libtiff/tiffconf.h.in
index 7c9559da..2a8b03e9 100644
--- a/libtiff/tiffconf.h.in
+++ b/libtiff/tiffconf.h.in
@@ -6,7 +6,8 @@
/* clang-format off */
/* clang-format disabled because CMake scripts are very sensitive to the
- * formatting of this file.
+ * formatting of this file. configure_file variables of type "@VAR@" are
+ * modified by clang-format and won't be substituted.
*/
#ifndef _TIFFCONF_