[PATCH] tools: Only update protocol version if something changed.

Rémi Bernon rbernon at codeweavers.com
Thu Mar 19 06:28:37 CDT 2020


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---

As the patches sent should not include the generated bits I'm calling
make_requests from my local makefiles. The protocol version then gets
updated although most of the time nothing changed and it makes ccache
less efficient on sources that include server_protocol.h.

 tools/make_requests | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/tools/make_requests b/tools/make_requests
index 8c5ada0f212..35001b80dab 100755
--- a/tools/make_requests
+++ b/tools/make_requests
@@ -406,10 +406,23 @@ print SERVER_PROT "    struct reply_header reply_header;\n";
 foreach my $req (@requests) { print SERVER_PROT "    struct ${req}_reply ${req}_reply;\n"; }
 print SERVER_PROT "};\n\n";
 
-printf SERVER_PROT "#define SERVER_PROTOCOL_VERSION %d\n\n", $protocol + 1;
+print SERVER_PROT "/* ### protocol_version begin ### */\n\n";
+printf SERVER_PROT "#define SERVER_PROTOCOL_VERSION %d\n\n", $protocol;
+print SERVER_PROT "/* ### protocol_version end ### */\n\n";
 print SERVER_PROT "#endif /* __WINE_WINE_SERVER_PROTOCOL_H */\n";
 close SERVER_PROT;
-update_file( "include/wine/server_protocol.h" );
+
+if (update_file( "include/wine/server_protocol.h" ))
+{
+    my @version_lines = ();
+
+    push @version_lines, sprintf( "#define SERVER_PROTOCOL_VERSION %d\n", $protocol + 1 );
+
+    replace_in_file( "include/wine/server_protocol.h",
+                     "### protocol_version begin ###",
+                     "### protocol_version end ###",
+                     @version_lines );
+}
 
 ### Output the dumping function tables
 
-- 
2.26.0.rc2




More information about the wine-devel mailing list