Commit 92324d84 by Patrick Steinhardt

util: clean up header includes

While "util.h" declares the macro `git__tolower`, which simply resorts
to tolower(3P) on Unix-like systems, the <ctype.h> header is only being
included in "util.c". Thus, anybody who has included "util.h" without
having <ctype.h> included will fail to compile as soon as the macro is
in use.

Furthermore, we can clean up additional includes in "util.c" and simply
replace them with an include for "common.h".
parent 06b8a40f
......@@ -7,10 +7,7 @@
#include "util.h"
#include "git2.h"
#include <stdio.h>
#include <ctype.h>
#include "posix.h"
#include "common.h"
#ifdef GIT_WIN32
# include "win32/w32_buffer.h"
......
......@@ -9,12 +9,16 @@
#include "common.h"
#ifndef GIT_WIN32
# include <ctype.h>
#endif
#include "git2/buffer.h"
#include "buffer.h"
#include "thread-utils.h"
#include "buffer.h"
#include "common.h"
#include "strnlen.h"
#include "thread-utils.h"
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
#define bitsizeof(x) (CHAR_BIT * sizeof(x))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment