system/ping.cpp: Conditionally use register keyword for backward compatibility;

remove for C++17 and later where it is not allowed


Origin commit data
------------------
Branch: ni/coolstream
Commit: ef0d29f448
Author: Thilo Graf <dbt@novatux.de>
Date: 2024-09-02 (Mon, 02 Sep 2024)



------------------
This commit was generated by Migit
This commit is contained in:
2024-09-02 21:06:01 +02:00
committed by vanhofen
parent 29f9743e15
commit 2c3e860a04

View File

@@ -46,7 +46,11 @@ static int sock = -1;
static int static int
in_checksum( u_short *buf, int len ) in_checksum( u_short *buf, int len )
{ {
register long sum = 0; #if __cplusplus < 201703L
register long sum = 0; // Use register for older standards
#else
long sum = 0; // register keyword is not allowed in C++17 and later
#endif
u_short answer = 0; u_short answer = 0;
while( len > 1 ){ while( len > 1 ){