Closed chobie closed 12 years ago
could not resolve undefined functions _snprintf and _strcasecmp. let me make a patch for win32
here the fix for the compilation
render_html_toc.c
in config.w32
php_sundown_buffer_t *object;
php_sundown_render_base_t *base
Example
PHP_METHOD(sundown_render_html, blockCode)
{
char *code, *block_code;
int code_len, block_code_len;
struct buf *input, *lang, *output;
php_sundown_buffer_t *object;
php_sundown_render_html_t *html;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"ss",&code, &code_len, &block_code, &block_code_len) == FAILURE) {
return;
}
html = (php_sundown_render_html_t *) zend_object_store_get_object(getThis() TSRMLS_CC);
php_sundown_render_base_t *base = (php_sundown_render_base_t *) zend_object_store_get_object(getThis() TSRMLS_CC);\
input = str2buf(block_code, block_code_len);
lang = str2buf(code, code_len);
output = bufnew(128);
html->cb.blockcode(output,lang,input, &base->html);
bufrelease(input);
bufrelease(lang);
RETVAL_STRINGL(output->data, output->size,1);
bufrelease(output);
}
Should be
PHP_METHOD(sundown_render_html, blockQuote)
{
char *quote;
int quote_len;
struct buf *input, *output;
php_sundown_buffer_t *object;
php_sundown_render_html_t *html;
php_sundown_render_base_t *base;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"s", "e, "e_len) == FAILURE) {
return;
}
html = (php_sundown_render_html_t *) zend_object_store_get_object(getThis() TSRMLS_CC);
base = (php_sundown_render_base_t *) zend_object_store_get_object(getThis() TSRMLS_CC);\
input = str2buf(quote, quote_len);
output = bufnew(128);
html->cb.blockquote(output,input, &base->html);
bufrelease(input);
RETVAL_STRINGL(output->data, output->size,1);
bufrelease(output);
}
@stealth35 you should send a pull request :)
@stealth35 Thank you for your advice. I'm working win32-support branch. please tell me if you have any suggestions. Thanks
git clone https://github.com/chobie/php-sundown.git --recursive
cd php-sundown
phpize
configure --with-php-build="c:\php-sdk\php53dev\vc9\x86\deps" --with-sundwon
nmake
https://github.com/chobie/php-sundown/compare/development...win32-support
probably this looks fine. I'll merge this into develop in this weekend.
for now, config.w32 does not specify latest files. let me fix it when i finished to implement Redcarpet2 like features.