Permalink
Browse files

I've compiled on win32(VC10)!

  • Loading branch information...
1 parent 87ea48d commit 59534d73e271f86f2528e61db3808cbfcad5d9ac @chobie committed May 22, 2012
Showing with 20 additions and 9 deletions.
  1. +5 −6 config.w32
  2. +5 −3 php_sundown.h
  3. +10 −0 sundown_markdown.c
View
@@ -1,15 +1,14 @@
ARG_WITH('sundown', 'sundown extension', 'no');
if (PHP_SUNDOWN != "no") {
- ADD_EXTENSION_DEP('sundown','spl',true);
-
- if (CHECK_HEADER_ADD_INCLUDE("markdown.h", "CFLAGS_SUNDOWN", "..\\pecl\\sundown\\sundown\\src") &&
- CHECK_HEADER_ADD_INCLUDE("html.h", "CFLAGS_SUNDOWN", "..\\pecl\\sundown\\sundown\\html")) {
- ADD_SOURCES(configure_module_dirname + "\\sundown\\src","buffer.c markdown.c autolink.c stack.c", "sundown");
- ADD_SOURCES(configure_module_dirname + "\\sundown\\html","html.c html_smartypants.c houdini_href_e.c houdini_html_e.c", "sundown");
+ if (CHECK_HEADER_ADD_INCLUDE("markdown.h", "CFLAGS_SUNDOWN", ".\\sundown\\src") &&
+ CHECK_HEADER_ADD_INCLUDE("html.h", "CFLAGS_SUNDOWN", ".\\sundown\\html")) {
+ ADD_SOURCES(configure_module_dirname + ".\\sundown\\src","buffer.c markdown.c autolink.c stack.c", "sundown");
+ ADD_SOURCES(configure_module_dirname + ".\\sundown\\html","html.c html_smartypants.c houdini_href_e.c houdini_html_e.c", "sundown");
EXTENSION("sundown", "php_sundown.c sundown_markdown.c render_base.c render_html.c render_html_toc.c render_xhtml.c");
} else {
WARNING( "sundown not enabled: headers not found");
}
+ ADD_EXTENSION_DEP('sundown','spl',true);
}
View
@@ -9,15 +9,17 @@
#include "config.h"
#endif
-#include "php.h"
#include "markdown.h"
#include "html.h"
-#include "ext/spl/spl_exceptions.h"
-
+#include "php.h"
#include "zend_interfaces.h"
#include "zend_exceptions.h"
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
/* Define the entry point symbol
* Zend will use when loading this module
*/
View
@@ -19,6 +19,7 @@
#include "php_sundown.h"
extern zend_class_entry *sundown_render_base_class_entry;
+static zend_class_entry *spl_ce_InvalidArgumentException;
zend_class_entry *sundown_markdown_class_entry;
@@ -630,4 +631,13 @@ void php_sundown_markdown_init(TSRMLS_D)
sundown_markdown_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
sundown_markdown_class_entry->create_object = php_sundown_markdown_new;
zend_declare_property_null(sundown_markdown_class_entry, "extensions", sizeof("extensions")-1, ZEND_ACC_PUBLIC TSRMLS_CC);
+
+ if (!spl_ce_InvalidArgumentException) {
+ /* when I'm building this extension on windows box. I can't fix redefintion macro error. for now lookup the class */
+ zend_class_entry **pce;
+
+ if (zend_hash_find(CG(class_table), "invalidargumentexception", sizeof("InvalidArgumentException"), (void **)&pce) == SUCCESS) {
+ spl_ce_InvalidArgumentException = *pce;
+ }
+ }
}

0 comments on commit 59534d7

Please sign in to comment.