@@ -1872,7 +1872,7 @@ namespace simplecpp {
18721872
18731873 class Macro {
18741874 public:
1875- /* * a usage of this macro: where it is used and, for INTn_C / UINTn_C, the argument as written in the call */
1875+ /* * a usage of this macro: where it is used and, for INTn_C / UINTn_C, the argument of the call */
18761876 struct Usage {
18771877 explicit Usage (const Location &location) : location(location) {}
18781878 Location location;
@@ -2271,18 +2271,19 @@ namespace simplecpp {
22712271 return parametertokens;
22722272 }
22732273
2274- /* * Is name one of the <stdint.h> integer constant macros INTn_C / UINTn_C, n = 8, 16, 32 or 64 ? */
2274+ /* * Is name one of the <stdint.h> integer constant macros INTn_C / UINTn_C, n = 8, 16, 32, 64 or MAX ? */
22752275 static bool isIntegerConstantMacro (const std::string &name) {
22762276 const std::string::size_type pos = (name.compare (0 , 1 , " U" ) == 0 ) ? 1 : 0 ;
22772277 if (name.compare (pos, 3 , " INT" ) != 0 )
22782278 return false ;
22792279 const std::string bits = name.substr (pos + 3 );
2280- return bits == " 8_C" || bits == " 16_C" || bits == " 32_C" || bits == " 64_C" ;
2280+ return bits == " 8_C" || bits == " 16_C" || bits == " 32_C" || bits == " 64_C" || bits == " MAX_C " ;
22812281 }
22822282
22832283 /* *
2284- * The text between the parentheses of the call as written: the tokens joined with a single space,
2285- * comments are skipped. nameTokInst is followed by '('.
2284+ * The text between the parentheses of the call: the tokens joined with a single space, comments are
2285+ * skipped. nameTokInst is followed by '('. If the call is in a macro body, the parameters of the
2286+ * enclosing macro have already been substituted and the macros in them expanded.
22862287 */
22872288 static std::string writtenArgument (const Token *nameTokInst, bool calledInDefine) {
22882289 std::string ret;
0 commit comments