au icon indicating copy to clipboard operation
au copied to clipboard

Switch from `#pragma once` to include guards

Open chiphogg opened this issue 1 year ago • 3 comments

This would be a more robust solution. #pragma once is fine for first-party code in a project, but for third party users, there will always be edge cases.

chiphogg avatar Sep 02 '24 23:09 chiphogg

@geoffviola mentions that there may be length restrictions (32 characters?), so we should look into that before we take the leap.

chiphogg avatar Sep 25 '24 18:09 chiphogg

(On some older compilers)

chiphogg avatar Sep 25 '24 18:09 chiphogg

C++ doesn't specify a limit on macro identifier length. C99 and later specifies it as the first 63 characters.

Even though there is no specific limit on the length of identifiers, early compilers had limits on the number of significant initial characters in identifiers and the linkers imposed stricter limits on the names with external linkage.

https://en.cppreference.com/w/c/language/identifier#:~:text=Even%20though%20there%20is%20no,the%20names%20with%20external%20linkage.

geoffviola avatar Sep 26 '24 13:09 geoffviola