Browse Source

LibC: Define WCHAR_{MIN,MAX}

Ali Mohammad Pur 3 năm trước cách đây
mục cha
commit
0fdf52f6dd
1 tập tin đã thay đổi với 10 bổ sung0 xóa
  1. 10 0
      Userland/Libraries/LibC/wchar.h

+ 10 - 0
Userland/Libraries/LibC/wchar.h

@@ -17,6 +17,16 @@ __BEGIN_DECLS
 #    define WEOF (0xffffffffu)
 #endif
 
+#undef WCHAR_MAX
+#undef WCHAR_MIN
+#define WCHAR_MAX __WCHAR_MAX__
+#ifdef __WCHAR_MIN__
+#    define WCHAR_MIN __WCHAR_MIN__
+#else
+// Note: This assumes that wchar_t is a signed type.
+#    define WCHAR_MIN (-WCHAR_MAX - 1)
+#endif
+
 typedef __WINT_TYPE__ wint_t;
 typedef unsigned long int wctype_t;