summaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorVicent Martí <tanoku@gmail.com>2012-05-09 04:37:02 +0200
committerVicent Martí <tanoku@gmail.com>2012-05-09 04:37:02 +0200
commit0f49200c9a72f7d8144eb663dee2c684d52ef42a (patch)
treef0587f4a4ee07b4e96818cf28cb11c6ffe30727a /src/util.h
parente65752bb3251f9a308fd4f9cb3b294c4f7d90783 (diff)
downloadlibgit2-0f49200c9a72f7d8144eb663dee2c684d52ef42a.tar.gz
msvc: Do not use `isspace`
Locale-aware bullshit bitting my ass again yo
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index a76800141..6321e21f5 100644
--- a/src/util.h
+++ b/src/util.h
@@ -194,4 +194,19 @@ GIT_INLINE(size_t) git__size_t_powerof2(size_t v)
return git__size_t_bitmask(v) + 1;
}
+GIT_INLINE(bool) git__isupper(int c)
+{
+ return (c >= 'A' && c <= 'Z');
+}
+
+GIT_INLINE(bool) git__isalpha(int c)
+{
+ return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'));
+}
+
+GIT_INLINE(bool) git__isspace(int c)
+{
+ return (c == ' ' || c == '\t' || c == '\n' || c == '\12');
+}
+
#endif /* INCLUDE_util_h__ */