On Thu, Oct 8, 2009 at 1:26 PM, Thomas Charron <twaf...@gmail.com> wrote: > On Thu, Oct 8, 2009 at 9:36 AM, <bruce.lab...@autoliv.com> wrote: >> In a file system_file_ops.c that is in the psocket library there is the >> statement >> #define wrap(f) wrap_#f >> I think this is supposed to do >> wrap(read)( .... ) ==> wrap_read( .... ) >> Are there circumstances when this does not work? C89, C99, ??? > Isn't it supposed to be double #? > #define wrap(f) wrap_##f
Confirmed: The single '#' character means Stringify the following value - a.k.a to put in double-quotes. The double '##' characters means to Token-join. Example File 1: #define wrap(f) wrap_#f wrap(read) Preprocessed output (gcc -E <testfile.c>) wrap_ "read" Example File 2: #define wrap(f) wrap_##f wrap(read) Preprocessed output (gcc -E <testfile.c>) wrap_read -- -- Thomas _______________________________________________ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/