build: make strerror() override-able
If we want to override `strerror()` in libjson-c to make tests consistent across platforms, we need to do it build-wide as configure/build option. Apple linkers make it really hard to override functions at link-time, and this seems to be locked down on travis-ci.org [ for security reasons I assume ]. While I got it to work locally, it did not work when running on travis. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
This commit is contained in:
12
strerror_override.h
Normal file
12
strerror_override.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef __STRERROR_OVERRIDE_H__
|
||||
#define __STRERROR_OVERRIDE_H__
|
||||
|
||||
#include "config.h"
|
||||
#include <errno.h>
|
||||
|
||||
#if ENABLE_STRERROR_OVERRIDE
|
||||
char *_json_c_strerror(int errno_in);
|
||||
#define strerror _json_c_strerror
|
||||
#endif
|
||||
|
||||
#endif /* __STRERROR_OVERRIDE_H__ */
|
||||
Reference in New Issue
Block a user