diff --git a/psqlodbc.h b/psqlodbc.h
index 0468e0a..785b6eb 100644
--- a/psqlodbc.h
+++ b/psqlodbc.h
@@ -9,6 +9,68 @@
 #ifndef __PSQLODBC_H__
 #define __PSQLODBC_H__
 
+#include <ctype.h>
+
+#define CHECK_TYPE(var, type)										\
+	{																\
+		__typeof(var) *__tmp;										\
+		__tmp = (type *) NULL;										\
+		(void) __tmp; /* to avoid "set but not used" warnings */	\
+	}
+
+#ifdef isalnum
+#undef isalnum
+#endif
+#define isalnum(x) ((CHECK_TYPE(x, unsigned char)), isalnum(x))
+#ifdef isalpha
+#undef isalpha
+#endif
+#define isalpha(x) ((CHECK_TYPE(x, unsigned char)), isalpha(x))
+#ifdef isascii
+#undef isascii
+#endif
+#define isascii(x) ((CHECK_TYPE(x, unsigned char)), isascii(x))
+#ifdef isblank
+#undef isblank
+#endif
+#define isblank(x) ((CHECK_TYPE(x, unsigned char)), isblank(x))
+#ifdef iscntrl
+#undef iscntrl
+#endif
+#define iscntrl(x) ((CHECK_TYPE(x, unsigned char)), iscntrl(x))
+#ifdef isdigit
+#undef isdigit
+#endif
+#define isdigit(x) ((CHECK_TYPE(x, unsigned char)), isdigit(x))
+#ifdef isgraph
+#undef isgraph
+#endif
+#define isgraph(x) ((CHECK_TYPE(x, unsigned char)), isgraph(x))
+#ifdef islower
+#undef islower
+#endif
+#define islower(x) ((CHECK_TYPE(x, unsigned char)), islower(x))
+#ifdef isprint
+#undef isprint
+#endif
+#define isprint(x) ((CHECK_TYPE(x, unsigned char)), isprint(x))
+#ifdef ispunct
+#undef ispunct
+#endif
+#define ispunct(x) ((CHECK_TYPE(x, unsigned char)), ispunct(x))
+#ifdef isspace
+#undef isspace
+#endif
+#define isspace(x) ((CHECK_TYPE(x, unsigned char)), isspace(x))
+#ifdef isupper
+#undef isupper
+#endif
+#define isupper(x) ((CHECK_TYPE(x, unsigned char)), isupper(x))
+#ifdef isxdigit
+#undef isxdigit
+#endif
+#define isxdigit(x) ((CHECK_TYPE(x, unsigned char)), isxdigit(x))
+
 /* #define	__MS_REPORTS_ANSI_CHAR__ */
 
 #ifndef WIN32
