Made the dependency on stdlib.h and assert.h optional #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR will make it possible for users to provide their own
malloc()
,free()
andassert()
wrappers. This means that using this library on Windows (if one plans on shipping without MSVCRT Redist) or on embedded platforms (without a libc) will be easier.The dependency on
mman.h
,windows.h
andunistd.h
are not touched, since I can't see why one might not want to use them on the relevant platforms.stdint.h
is also left in since it only provides type definitions and not any functions.The dependencies are still mandatory in the following files:
sjlj.c
:setjmp
/longjmp
are libc features anywayucontext.c
: No reason not to link to libc on POSIX systemsppc.c
: Still usesstring.h
formemcpy
. Sincememcpy
is usually a compiler intrinsic with some spec-mandated magical behaviour, not sure if it's technically safe to override it.