Skip to content

Commit d6eb388

Browse files
author
Marcel Meulemans
committed
Remove dependency on libm
Just to save a few bytes when compiling for embedded systems.
1 parent d668e8e commit d6eb388

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

json-builder.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@
3333
#include <string.h>
3434
#include <assert.h>
3535
#include <stdio.h>
36-
#include <math.h>
3736

3837
#ifdef _MSC_VER
3938
#define snprintf _snprintf
4039
#endif
4140

41+
static double floor(double d) {
42+
return d - ((int)d % 1);
43+
}
44+
4245
static const json_serialize_opts default_opts =
4346
{
4447
json_serialize_mode_single_line,

0 commit comments

Comments
 (0)