[PATCH] D131925: Undef FS and CS macros for Android x86_64
    Pirama Arumuga Nainar via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Aug 22 11:49:06 PDT 2022
    
    
  
pirama added a comment.
> An alternative is not to use FS or CS in these .h files, but #undef before use seems less intrusive.
Fixing it like this is confusing though.  `CS` and `FS` are used in several other header files in llvm and clang.  And this fits perfectly into the coding style used in LLVM.  With this fix, it's unclear why we need to `undef FS|CS` in LLVM some headers and not others.  The reason is subtle in that it's needed only for those headers that are included in lldb _after_ Android's ptrace.h is included.  Fixing this break closer to the point of origin of the discrepancy makes it easier to understand.
> These .h files won't compile for other include paths or with any other system files that define FS or CS.
AFAICT, the include in `Procfs.h` is the only instance of this error.  Building `lldb-server` passes with adding a `#undef` there.  If other include paths arise in the future, we can revisit and extend this fix while still keeping it self-contained.
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131925/new/
https://reviews.llvm.org/D131925
    
    
More information about the llvm-commits
mailing list