mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-26 23:13:13 +02:00
system/ping.cpp: Conditionally use register keyword for backward compatibility;
remove for C++17 and later where it is not allowed
This commit is contained in:
@@ -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 ){
|
||||||
|
Reference in New Issue
Block a user