From c2e08021005f54e83d45e3961edb0cf6780b0296 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 26 Apr 2022 08:53:09 +0200 Subject: [PATCH] Document const, inline, volatile checks semantics --- libbuild2-autoconf/libbuild2/autoconf/checks/const.h | 6 ++++++ libbuild2-autoconf/libbuild2/autoconf/checks/inline.h | 6 ++++++ libbuild2-autoconf/libbuild2/autoconf/checks/volatile.h | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/const.h b/libbuild2-autoconf/libbuild2/autoconf/checks/const.h index abff54f..c86d055 100644 --- a/libbuild2-autoconf/libbuild2/autoconf/checks/const.h +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/const.h @@ -1,2 +1,8 @@ // const + +/* This check is unusual in that for a positive answer (the compiler supports + const) we undefine const to allow the compiler to recognize it as a keyword + and for a negative answer we define it to nothing so that const is + effectively removed from the user code. */ + #undef const diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/inline.h b/libbuild2-autoconf/libbuild2/autoconf/checks/inline.h index d0b9ec9..804fa91 100644 --- a/libbuild2-autoconf/libbuild2/autoconf/checks/inline.h +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/inline.h @@ -1,2 +1,8 @@ // inline + +/* This check is unusual in that for a positive answer (the compiler supports + inline) we undefine inline to allow the compiler to recognize it as a + keyword and for a negative answer we define it to nothing so that inline is + effectively removed from the user code. */ + #undef inline diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/volatile.h b/libbuild2-autoconf/libbuild2/autoconf/checks/volatile.h index f3b8f67..ead70a3 100644 --- a/libbuild2-autoconf/libbuild2/autoconf/checks/volatile.h +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/volatile.h @@ -1,2 +1,8 @@ // volatile + +/* This check is unusual in that for a positive answer (the compiler supports + volatile) we undefine volatile to allow the compiler to recognize it as a + keyword and for a negative answer we define it to nothing so that volatile + is effectively removed from the user code. */ + #undef volatile