Skip to content

Commit

Permalink
uthash: Include <stdio.h> when HASH_DEBUG is set.
Browse files Browse the repository at this point in the history
This way the user doesn't have to `#include <stdio.h>` just because
someone on the command line did a `-DHASH_DEBUG`.
  • Loading branch information
Quuxplusone committed Nov 27, 2019
1 parent 15fc1b2 commit e06180a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/uthash.h
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,8 @@ do {
* This is for uthash developer only; it compiles away if HASH_DEBUG isn't defined.
*/
#ifdef HASH_DEBUG
#define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0)
#include <stdio.h> /* fprintf, stderr */
#define HASH_OOPS(...) do { fprintf(stderr, __VA_ARGS__); exit(-1); } while (0)
#define HASH_FSCK(hh,head,where) \
do { \
struct UT_hash_handle *_thh; \
Expand Down
2 changes: 1 addition & 1 deletion tests/test95.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <assert.h>
#include <stdio.h>
#include <stddef.h> /* size_t, NULL */
#include "utstack.h"

typedef struct el {
Expand Down

0 comments on commit e06180a

Please sign in to comment.