Add comments about the minimum __WORDSIZE.

This commit is contained in:
Nigel Tao committed 2017-05-26 14:51:48 +10:00
1 parent d7403b8e57
commit 371abbde2e
4 files changed
+13 -1

No files matched your search

+4
View File
@@ -6,6 +6,10 @@
#include <stdbool.h>
#include <stdint.h>
// Puffs requires a word size of at least 32 bits because it assumes that
// converting a u32 to usize will never overflow. For example, the size of a
// decoded image is often represented, explicitly or implicitly in an image
// file, as a u32, and it is convenient to compare that to a buffer size.
#if __WORDSIZE < 32
#error "Puffs requires a word size of at least 32 bits"
#endif
+4
View File
@@ -6,6 +6,10 @@
#include <stdbool.h>
#include <stdint.h>
// Puffs requires a word size of at least 32 bits because it assumes that
// converting a u32 to usize will never overflow. For example, the size of a
// decoded image is often represented, explicitly or implicitly in an image
// file, as a u32, and it is convenient to compare that to a buffer size.
#if __WORDSIZE < 32
#error "Puffs requires a word size of at least 32 bits"
#endif