external libs, libmodplug: Fix -Wregister warnings from new gcc:
authorOzkan Sezer <sezeroz@gmail.com>
Sun, 01 Dec 2019 18:50:02 +0300
changeset 105154ace9af9480
parent 1050 300088719593
child 1052 5500d13631b4
external libs, libmodplug: Fix -Wregister warnings from new gcc:

warning: ISO C++17 does not allow 'register' storage class specifier

Noticed in a commit authored by Vitaly Novichkov.
external/libmodplug-0.8.9.0/src/fastmix.cpp
     1.1 --- a/external/libmodplug-0.8.9.0/src/fastmix.cpp	Sun Dec 01 11:20:02 2019 +0300
     1.2 +++ b/external/libmodplug-0.8.9.0/src/fastmix.cpp	Sun Dec 01 18:50:02 2019 +0300
     1.3 @@ -287,8 +287,14 @@
     1.4  // ----------------------------------------------------------------------------
     1.5  // MIXING MACROS
     1.6  // ----------------------------------------------------------------------------
     1.7 +#if defined(__cplusplus) && (__cplusplus >= 201402L)
     1.8 +#define REGISTER
     1.9 +#else
    1.10 +#define REGISTER register
    1.11 +#endif
    1.12 +
    1.13  #define SNDMIX_BEGINSAMPLELOOP8\
    1.14 -	register MODCHANNEL * const pChn = pChannel;\
    1.15 +	REGISTER MODCHANNEL * const pChn = pChannel;\
    1.16  	nPos = pChn->nPosLo;\
    1.17  	const signed char *p = (signed char *)(pChn->pCurrentSample+pChn->nPos);\
    1.18  	if (pChn->dwFlags & CHN_STEREO) p += pChn->nPos;\
    1.19 @@ -296,7 +302,7 @@
    1.20  	do {
    1.21  
    1.22  #define SNDMIX_BEGINSAMPLELOOP16\
    1.23 -	register MODCHANNEL * const pChn = pChannel;\
    1.24 +	REGISTER MODCHANNEL * const pChn = pChannel;\
    1.25  	nPos = pChn->nPosLo;\
    1.26  	const signed short *p = (signed short *)(pChn->pCurrentSample+(pChn->nPos*2));\
    1.27  	if (pChn->dwFlags & CHN_STEREO) p += pChn->nPos;\