diff --git a/include/fwrite_le.h b/include/fwrite_le.h index 76127a3..6eb6fd1 100644 --- a/include/fwrite_le.h +++ b/include/fwrite_le.h @@ -18,7 +18,11 @@ #define ifeq_b32_ret(lhs, rhs, value) if (!memcmp(lhs, rhs, 4)) return value; int detect_endianness(void); -size_t fwrite_le(void* ptr, size_t size, size_t count, FILE* stream); +size_t fwrite_le( +#if FWRITE_LE_NO_MODIFICATION + const +#endif + void* ptr, size_t size, size_t count, FILE* stream); void reorder_le_be( #if FWRITE_LE_NO_MODIFICATION uint8_t* dest, uint8_t* src, diff --git a/src/fwrite_le.c b/src/fwrite_le.c index 473124c..e9beb3f 100644 --- a/src/fwrite_le.c +++ b/src/fwrite_le.c @@ -37,7 +37,11 @@ void reorder_le_be( } } -size_t fwrite_le(void* ptr, size_t size, size_t count, FILE* stream) { +size_t fwrite_le( +#if FWRITE_LE_NO_MODIFICATION + const +#endif + void* ptr, size_t size, size_t count, FILE* stream) { /* * warning: this function modifies `void* ptr` by default! * (if FWRITE_LE_NO_MODIFICATION in the header is 0)