mojoshader_preprocessor.c
changeset 881 a22fe996c5a4
parent 875 dc28354d576e
child 882 dd526bab5a51
equal deleted inserted replaced
880:a3a9488856f7 881:a22fe996c5a4
  1385                     {
  1385                     {
  1386                         if (paren == 1)  // new macro arg?
  1386                         if (paren == 1)  // new macro arg?
  1387                             break;
  1387                             break;
  1388                     } // else if
  1388                     } // else if
  1389 
  1389 
  1390                     // is this an arg in the current macro?
  1390                     // see if a replacement is in order...
  1391                     //  This is a special case, we need to replace here.
  1391                     // !!! FIXME: this fails if we get another macro with args:
  1392                     else if ((state->is_macro) && (t == TOKEN_IDENTIFIER))
  1392                     // !!! FIXME:  macro1(macro2(arg))
       
  1393                     else if (t == TOKEN_IDENTIFIER)
  1393                     {
  1394                     {
  1394                         const Define *arg = find_macro_arg(state);
  1395                         const Define *arg = NULL;
       
  1396                         if (state->is_macro)
       
  1397                             arg = find_macro_arg(state);
       
  1398                         if (arg == NULL)
       
  1399                             arg = find_define_by_token(ctx);
  1395                         if (arg)
  1400                         if (arg)
  1396                         {
  1401                         {
  1397                             expr = arg->definition;
  1402                             expr = arg->definition;
  1398                             exprlen = strlen(arg->definition);
  1403                             exprlen = strlen(arg->definition);
  1399                         } // if
  1404                         } // if