Frankenstella, a PHP compiler
Tuesday, June 01, 2004
 
Compiling Zend!
compiling zend_language.scanner.c zend_language_parser.c

u have to have have all the files located in the Zend dir as well as the TSRM dir on the same level as the Zend dir.

I get as far as compiling to the stage where:
zend_language_scanner.l (165): error C2491: zend_save_lexical_state :definition of dllimport function not allowed
(few more errors of the similar nature are spewed out, varying only in terms of line number)

Now when it comes to the error, after googling, it seems that its a VC specific error.
After looking through MSDN i found Compiler Error C2491

So i figured i could probably change something in zend_language_scanner.l
Upon investgation of the specific line numbers (165,185,216,266,272,350,459) there lies a pattern... the prob seems to be in functions looking like

ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC)
{
memcpy(&lex_state->buffer_state, &YY_CURRENT_BUFFER, sizeof(YY_BUFFER_STATE));
lex_state->in = SCNG(yy_in);
lex_state->state = YYSTATE;
lex_state->filename = zend_get_compiled_filename(TSRMLS_C);
lex_state->lineno = CG(zend_lineno);
#ifdef ZEND_MULTIBYTE
lex_state->code = SCNG(code);
lex_state->code_size = SCNG(code_size);
lex_state->current_code = SCNG(current_code);
lex_state->current_code_size = SCNG(current_code_size);
lex_state->input_filter = SCNG(input_filter);
lex_state->output_filter = SCNG(output_filter);
lex_state->script_encoding = SCNG(script_encoding);
lex_state->internal_encoding = SCNG(internal_encoding);
#endif /* ZEND_MULTIBYTE */
}

So, ZEND_API must be defining the function as some sort of dllimport function. So comment out ZEND_API and recompile... Same errors. Tough Luck.

So maybe the problem is in the data type zend_lex_state, where is that defined? In none other than zend_language_scanner.h obviously... which looks fine... arrgghh...

Give up for now...

Comments: Post a Comment

<< Home

Powered by Blogger