Lines Matching defs:macro
114 const char *macro,
120 const char *macro,
196 /* Perform macro expansion in-place on the given list. */
1040 This macro was not mandated originally: define only if we know
1595 be undefined if yyoverflow is a macro. */
1762 glcpp_error(& (yylsp[-2]), parser, "undefined macro %s in expression (illegal in GLES)", (yyvsp[-1].expression_value).undefined_macro);
1772 glcpp_error(& (yylsp[-2]), parser, "undefined macro %s in expression (illegal in GLES)", (yyvsp[-1].expression_value).undefined_macro);
1857 * (pre-defined) macro name.
1865 * By convention, all macro names containing two consecutive
1870 * multiple definitions of the same name. All macro names
1952 macro_t *macro = entry ? entry->data : NULL;
1953 _glcpp_parser_skip_stack_push_if (parser, & (yylsp[-4]), macro != NULL);
1963 macro_t *macro = entry ? entry->data : NULL;
1964 _glcpp_parser_skip_stack_push_if (parser, & (yylsp[-2]), macro == NULL);
2106 glcpp_error (& (yylsp[-2]), parser, "#define without macro name");
3657 /* Find a set of function-like macro arguments by looking for a
3674 * simply that the macro name should be treated as a non-macro.
3767 * If the identifier is a defined macro, this function returns 1.
3769 * If the identifier is not a defined macro, this function returns 0.
3880 /* Perform macro expansion on 'list', placing the resulting tokens
3931 yyerror(&node->token->location, parser, "'##' cannot appear at either end of a macro expansion\n");
3950 * function-like macro, it is not followed with a parenthesized
3954 * macro) and subsequent nodes which are arguments.
3969 macro_t *macro;
3979 macro = entry ? entry->data : NULL;
3981 assert(macro->is_function);
3996 /* Replace a macro defined as empty with a SPACE token. */
3997 if (macro->replacements == NULL) {
4002 _string_list_length (macro->parameters)) ||
4003 (_string_list_length (macro->parameters) == 0 &&
4007 "Error: macro %s invoked with %d arguments (expected %d)\n",
4009 _string_list_length(macro->parameters));
4016 for (node = macro->replacements->head; node; node = node->next) {
4018 _string_list_contains(macro->parameters, node->token->value.str,
4052 * 'node' in the case that 'node' is a function-like macro and
4061 * As 'node' in the case of object-like macro expansion.
4064 * function-like macro expansion.
4076 macro_t *macro;
4100 macro = entry ? entry->data : NULL;
4102 /* Not a macro, so no expansion needed. */
4103 if (macro == NULL)
4106 /* Finally, don't expand this macro if we're already actively
4122 if (! macro->is_function) {
4125 /* Replace a macro defined as empty with a SPACE token. */
4126 if (macro->replacements == NULL)
4129 replacement = _token_list_copy(parser, macro->replacements);
4202 * token is the name of a defined macro. If the DEFINED token is
4303 * "All macro names containing two consecutive underscores ( __ )
4304 * are reserved for future use as predefined macro names. All
4305 * macro names prefixed with "GL_" ("GL" followed by a single
4325 glcpp_error (loc, parser, "\"defined\" cannot be used as a macro name");
4347 macro_t *macro, *previous;
4356 macro = linear_alloc_child(parser->linalloc, sizeof(macro_t));
4358 macro->is_function = 0;
4359 macro->parameters = NULL;
4360 macro->identifier = linear_strdup(parser->linalloc, identifier);
4361 macro->replacements = replacements;
4366 if (_macro_equal (macro, previous)) {
4369 glcpp_error (loc, parser, "Redefinition of macro %s\n", identifier);
4372 _mesa_hash_table_insert (parser->defines, identifier, macro);
4380 macro_t *macro, *previous;
4388 glcpp_error (loc, parser, "Duplicate macro parameter \"%s\"", dup);
4391 macro = linear_alloc_child(parser->linalloc, sizeof(macro_t));
4393 macro->is_function = 1;
4394 macro->parameters = parameters;
4395 macro->identifier = linear_strdup(parser->linalloc, identifier);
4396 macro->replacements = replacements;
4401 if (_macro_equal (macro, previous)) {
4404 glcpp_error (loc, parser, "Redefinition of macro %s\n", identifier);
4407 _mesa_hash_table_insert(parser->defines, identifier, macro);
4422 * function-like macro name, but have not yet seen its
4455 macro_t *macro = entry ? entry->data : NULL;
4456 if (macro && macro->is_function) {
4589 * fragment shader, so we always define this macro in ES2/ES3.