rlutil icon indicating copy to clipboard operation
rlutil copied to clipboard

Add #pragma once standard include guard fallback

Open Zorgatone opened this issue 10 years ago • 6 comments

Zorgatone avatar Jan 22 '16 15:01 Zorgatone

:-1: #pragma once is supported by every compiler and #define guards are potentially slower.

nabijaczleweli avatar Jan 22 '16 15:01 nabijaczleweli

Potentially slower by 1/10000th second...

refi64 avatar Jan 22 '16 16:01 refi64

Potentially slower by an HDD access, at least keep the #pragma once on top of the include guard.

nabijaczleweli avatar Jan 22 '16 16:01 nabijaczleweli

While not standard, #pragma once is pretty universally supported and it's much nicer than include guards. Granted, with just one header, it's kind of moot... Anyway, I'd be interested to know your compiler name and version if it really choked on it.

tapio avatar Jan 22 '16 16:01 tapio

My compiler supports it. I'm just suggesting to keep it standard. It's better this way just to be sure.

It's not that slow imho

Zorgatone avatar Jan 22 '16 16:01 Zorgatone

Edited to use both the #pragma once and standard include guard (fallback)

as discussed on stackoverflow: https://stackoverflow.com/questions/787533/is-pragma-once-a-safe-include-guard and: https://stackoverflow.com/questions/1143936/pragma-once-vs-include-guards

Zorgatone avatar Jan 25 '16 09:01 Zorgatone