Browse Source

Move a header back that shouldn't have been moved

I moved this before when I was using ssize_t in linkhash.c, but I moved
`struct lh_string` to `struct json_key` in a different file, so this isn't needed anymore
pull/715/head
HexTheDragon 4 years ago
parent
commit
95225e6a32
2 changed files with 14 additions and 14 deletions
  1. +14
    -1
      json_object.c
  2. +0
    -13
      math_compat.h

+ 14
- 1
json_object.c View File

@@ -39,6 +39,19 @@
#error "The long long type isn't 64-bits"
#endif

#include <limits.h>
#ifndef SSIZE_T_MAX
#if SIZEOF_SSIZE_T == SIZEOF_INT
#define SSIZE_T_MAX INT_MAX
#elif SIZEOF_SSIZE_T == SIZEOF_LONG
#define SSIZE_T_MAX LONG_MAX
#elif SIZEOF_SSIZE_T == SIZEOF_LONG_LONG
#define SSIZE_T_MAX LLONG_MAX
#else
#error Unable to determine size of ssize_t
#endif
#endif

// Don't define this. It's not thread-safe.
/* #define REFCOUNT_DEBUG 1 */

@@ -1215,7 +1228,7 @@ static int _json_object_userdata_to_json_string(struct json_object *jso, struct
int json_object_userdata_to_json_string(struct json_object *jso, struct printbuf *pb, int level,
int flags)
{
int userdata_len = strlen((const char *)jso->_userdata);
size_t userdata_len = strlen((const char *)jso->_userdata);
printbuf_memappend(pb, (const char *)jso->_userdata, userdata_len);
return userdata_len;
}


+ 0
- 13
math_compat.h View File

@@ -40,17 +40,4 @@
#define HAVE_DECL_NAN
#endif

#include <limits.h>
#ifndef SSIZE_T_MAX
#if SIZEOF_SSIZE_T == SIZEOF_INT
#define SSIZE_T_MAX INT_MAX
#elif SIZEOF_SSIZE_T == SIZEOF_LONG
#define SSIZE_T_MAX LONG_MAX
#elif SIZEOF_SSIZE_T == SIZEOF_LONG_LONG
#define SSIZE_T_MAX LLONG_MAX
#else
#error Unable to determine size of ssize_t
#endif
#endif

#endif

Loading…
Cancel
Save