My first patch: AMFEXT
| From: | J. Adams | Date: | Thu, 29 Jul 2010 22:13:50 +0000 |
| Subject: | My first patch: AMFEXT | ||
| Groups: | php.pecl.dev | ||
| Request: | Send a blank email to pecl-dev+get-7399@lists.php.net to get a copy of this message | ||
I know this is hardly much of a fix, but since it compiles on windows
and OSX, I am submitting my first patch for AMFEXT. I have successfully
compiled it on my Win XP desktop using SDK 6.1 and 32-bit compilers and
I have also compiled it successfully on OSX 10.5. It reflects some
changes I've made as well as some contributions [which I don't fully
understand] from a guy named Mikko on irc:#php.pecl. I have attached an
svn diff patch to this email.
The changes include the following
1) Changed references to ZVAL_ADDREF, ZVAL_DELREF, and ZVAL_REFCOUNT to
Z_ADDREF, Z_DELREF and Z_REFCOUNT, respectively per Gustavo Lopes'
sagacious instruction. Added conditional declarations of the new macros
per Michael Maclean's generous suggestion. This is what permits
compilation in my WinXP environment.
2) Added REGISTER_LONG_CONSTANT declarations to PHP_MINIT_FUNCTION so
that these flag constants are available within PHP. I reckon there
should be more added but am not sure which yet.
3) Changes made by Mikko to remove reference to zend_get_parameters_ex
in favor of zend_parse_parameters. There are still 6 instances of the
older funtion which I'd like to work on but I'll need some time to
understand exactly what's going on in the code.
4) Re-ordering of code so that constant declarations precede MINIT
function in which they are used.
I hope this helps and that it might demonstrate my sincere desire to
improve amfext. Maybe I could get a pecl account now?
In the meantime, I desperately want to know how I might set up some kind
of debugging situation whereby I might be privy to the inner workings of
this code as it runs. Is there some way to enable traces from the code?
Is there some IDE setup whereby I can set breakpoints, trace code, and
inspect variable contents? I have a little function that accepts
printf-type parameters and writes this to a log file, but that hardly
seems efficient. Per Emanuele's suggestion, I've also tried the exact
steps listed here:
http://blog.slickedit.com/2007/09/creating-a-php-5-extension-with-visual-c-2005/
But a build results in 100 'already defined' errors.
Thanks to Gustavo, Michael, and Pierre (and E. Smart on irc) for assistance.