fegennari / 3DWorld

3D Procedural Game Engine Using OpenGL
GNU General Public License v3.0
1.15k stars 89 forks source link

reserved identifier violation #5

Closed elfring closed 4 years ago

elfring commented 4 years ago

I would like to point out that identifiers like “_ASTEROID_H_” and “_BUILDING_H_do not fit to the expected naming convention of the C language standard. Would you like to adjust your selection for unique names?

fegennari commented 4 years ago

Thanks. I wasn't aware of the underscore naming convention rules. I've never run into a problem with this before. It's probably best to change all 66 headers to use "#pragma once" instead of these macro include guards to match the newer headers that already do it this way. That took a while but it's committed.

elfring commented 4 years ago

The construct “#pragma once” is not standard compliant.

fegennari commented 4 years ago

Interesting. I wasn't aware of that either. I have been using this in both Visual Studio and gcc for a while now without problems. I've had "#pragma once" in 3DWorld for about two years now in some of the newer header files. While it may not be standard compliant, I prefer to leave it in until I run into an actual problem. Also, because it's been in use in other files, I don't consider this change a regression. Maybe I'll get back to this later. Thank you.