How to check if a parameter is an integral constant expression in a C preprocessor macro?
问题 I'm currently cleaning up an existing C-library to publish it shamelessly. A preprocessor macro NPOT is used to calculate the next greater power of two for a given integral constant expression at compile time . The macro is normally used in direct initialisations. For all other cases (e.g. using variable parameters), there is an inline function with the same function. But if the user passes a variable, the algorithm expands to a huge piece of machine code. My question is: What may I do to