Rémi Bernon : tools: Only update protocol version if something changed.

Alexandre Julliard julliard at winehq.org
Thu Mar 19 16:27:48 CDT 2020


Module: wine
Branch: master
Commit: f181d5ce82470639459555cd59a076963861a61d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f181d5ce82470639459555cd59a076963861a61d

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Thu Mar 19 12:28:37 2020 +0100

tools: Only update protocol version if something changed.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 include/wine/server_protocol.h |  4 ++++
 tools/make_requests            | 17 +++++++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h
index af4507b5d1..ba70d13a39 100644
--- a/include/wine/server_protocol.h
+++ b/include/wine/server_protocol.h
@@ -6706,6 +6706,10 @@ union generic_reply
     struct resume_process_reply resume_process_reply;
 };
 
+/* ### protocol_version begin ### */
+
 #define SERVER_PROTOCOL_VERSION 596
 
+/* ### protocol_version end ### */
+
 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */
diff --git a/tools/make_requests b/tools/make_requests
index 4e39bb65a9..a30c9be905 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
 




More information about the wine-cvs mailing list