#define Z_DOMOBJ_P(zv) php_dom_obj_from_obj(Z_OBJ_P((zv)))
#ifdef PHP_WIN32
-# ifdef PHPAPI
-# undef PHPAPI
-# endif
# ifdef DOM_EXPORTS
-# define PHPAPI __declspec(dllexport)
-# else
-# define PHPAPI __declspec(dllimport)
+# define PHP_DOM_EXPORT __declspec(dllexport)
+# elif !defined(DOM_LOCAL_DEFINES) /* Allow to counteract LNK4049 warning. */
+# define PHP_DOM_EXPORT __declspec(dllimport)
+# else
+# define PHP_DOM_EXPORT
# endif /* DOM_EXPORTS */
#elif defined(__GNUC__) && __GNUC__ >= 4
-# ifdef PHPAPI
-# undef PHPAPI
-# endif
-# define PHPAPI __attribute__ ((visibility("default")))
-#endif /* PHP_WIN32 */
-
-#define PHP_DOM_EXPORT PHPAPI
+# define PHP_DOM_EXPORT __attribute__ ((visibility("default")))
+#elif defined(PHPAPI)
+# define PHP_DOM_EXPORT PHPAPI
+#else
+# define PHP_DOM_EXPORT
+#endif
PHP_DOM_EXPORT extern zend_class_entry *dom_node_class_entry;
PHP_DOM_EXPORT dom_object *php_dom_object_get_data(xmlNodePtr obj);
#include "ext/libxml/php_libxml.h"
#include <libxml/xmlreader.h>
+/* If xmlreader and dom both are compiled statically,
+ no DLL import should be used in xmlreader for dom symbols. */
+#ifdef PHP_WIN32
+# if defined(HAVE_DOM) && !defined(COMPILE_DL_DOM)
+# define DOM_LOCAL_DEFINES 1
+# endif
+#endif
+
typedef struct _xmlreader_object {
xmlTextReaderPtr ptr;
/* strings must be set in input buffer as copy is required */