callofduty4x / CoD4x_Server

Extended Call of Duty 4 server
https://cod4x.ovh
GNU Affero General Public License v3.0
335 stars 121 forks source link

Updated code to compile on current version compilers without errors. #413

Closed IONRetailSystems closed 1 year ago

IONRetailSystems commented 1 year ago

To allow compilation on current Linux compilers, I changed all byte type definitions to cod4xbyte definition to avoid compiler conflicts, removed some duplicate definitions. Code tested and working fine.

I did also add back in the botnames.txt functionality as I use that myself on my servers but I can rework that if desired for the publicly available code.

proxict commented 1 year ago

This is definitely not a good idea and doesn't solve the root cause of the problem. The real issue is the the pollution of the global namespace by the standard's functions and types because of using namespace std. The proper fix is to eradicate this statement from the codebase. Oh and also the -fcommon flag is necessary for gcc >= 10 to fix the conflicts during linking.

This was my lazy method of fixing the compile errors: https://github.com/callofduty4x/CoD4x_Server/commit/88e5e4ecd448412d4f9cee13bd39b5d35f30d528