ms-null-ms-header-vs-stddef.cpp 587 B

12345678910111213141516
  1. // RUN: %clang_cc1 -fsyntax-only -triple i686-pc-win32 -fms-compatibility -fms-compatibility-version=17.00 %s
  2. // RUN: %clang_cc1 -fsyntax-only -triple i386-mingw32 %s
  3. // Something in MSVC's headers (pulled in e.g. by <crtdefs.h>) defines __null
  4. // to something, mimick that.
  5. #define __null
  6. #include <stddef.h>
  7. // __null is used as a type annotation in MS headers, with __null defined to
  8. // nothing in regular builds. This should continue to work even with stddef.h
  9. // included.
  10. void f(__null void* p) { }
  11. // NULL should work fine even with __null defined to nothing.
  12. void* p = NULL;