Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions libcudacxx/include/cuda/std/__cccl/epilogue.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,4 +352,20 @@ _CCCL_DIAG_POP
# undef _CCCL_POP_MACRO_clang
#endif

// major and minor are defined in sys/sysmacros.h in libc
#if defined(major)
# error \
"cccl internal error: macro `major` was redefined between <cuda/std/__cccl/prologue.h> and <cuda/std/__cccl/epilogue.h>"
#elif defined(_CCCL_POP_MACRO_major)
# pragma pop_macro("major")
# undef _CCCL_POP_MACRO_major
#endif

#if defined(minor)
# error \
"cccl internal error: macro `minor` was redefined between <cuda/std/__cccl/prologue.h> and <cuda/std/__cccl/epilogue.h>"
#elif defined(_CCCL_POP_MACRO_minor)
# pragma pop_macro("minor")
# undef _CCCL_POP_MACRO_minor
#endif
// NO include guards here (this file is included multiple times)
13 changes: 13 additions & 0 deletions libcudacxx/include/cuda/std/__cccl/prologue.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,19 @@
# define _CCCL_POP_MACRO_clang
#endif // defined(clang)

// major and minor are defined in sys/sysmacros.h in libc
#if defined(major)
# pragma push_macro("major")
# undef clang
# define _CCCL_POP_MACRO_major
#endif // defined(major)

#if defined(minor)
# pragma push_macro("minor")
# undef clang
# define _CCCL_POP_MACRO_minor
#endif // defined(minor)

_CCCL_DIAG_PUSH
_CCCL_NV_DIAG_PUSH()

Expand Down
Loading