[libc-commits] [PATCH] D94642: [libc] Use #undef isascii in specific header

Roland McGrath via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jan 14 13:25:28 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe7228062b2bb: [libc] Use #undef isascii in specific header (authored by mcgrathr).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94642/new/

https://reviews.llvm.org/D94642

Files:
  libc/src/ctype/isascii.h
  libc/test/src/ctype/isascii_test.cpp
  libc/utils/UnitTest/FuchsiaTest.h


Index: libc/utils/UnitTest/FuchsiaTest.h
===================================================================
--- libc/utils/UnitTest/FuchsiaTest.h
+++ libc/utils/UnitTest/FuchsiaTest.h
@@ -10,11 +10,5 @@
 #define LLVM_LIBC_UTILS_UNITTEST_FUCHSIATEST_H
 
 #include <zxtest/zxtest.h>
-// isascii is being undef'd because Fuchsia's headers define a macro for
-// isascii. that macro causes errors when isascii_test.cpp references
-// __llvm_libc::isascii since the macro is applied first.
-#ifdef isascii
-#undef isascii
-#endif
 
 #endif // LLVM_LIBC_UTILS_UNITTEST_FUCHSIATEST_H
Index: libc/test/src/ctype/isascii_test.cpp
===================================================================
--- libc/test/src/ctype/isascii_test.cpp
+++ libc/test/src/ctype/isascii_test.cpp
@@ -6,10 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "src/ctype/isascii.h"
-
 #include "utils/UnitTest/Test.h"
 
+#include "src/ctype/isascii.h"
+
 TEST(IsAscii, DefaultLocale) {
   // Loops through all characters, verifying that ascii characters
   //    (which are all 7 bit unsigned integers)
Index: libc/src/ctype/isascii.h
===================================================================
--- libc/src/ctype/isascii.h
+++ libc/src/ctype/isascii.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_LIBC_SRC_CTYPE_ISASCII_H
 #define LLVM_LIBC_SRC_CTYPE_ISASCII_H
 
+#undef isascii
+
 namespace __llvm_libc {
 
 int isascii(int c);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94642.316767.patch
Type: text/x-patch
Size: 1451 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20210114/5c03f76f/attachment.bin>


More information about the libc-commits mailing list