]> granicus.if.org Git - php/commitdiff
use *_EXTERN_C() and PHP_WIN32
authorHarald Radi <phanto@php.net>
Mon, 29 Jan 2001 21:54:46 +0000 (21:54 +0000)
committerHarald Radi <phanto@php.net>
Mon, 29 Jan 2001 21:54:46 +0000 (21:54 +0000)
14 files changed:
ext/com/COM.c
ext/com/VARIANT.c
ext/com/conversion.c
ext/com/conversion.h
ext/com/php_COM.h
ext/com/php_VARIANT.h
ext/dotnet/dotnet.cpp
ext/rpc/com/com_wrapper.c
ext/rpc/com/conversion.c
ext/rpc/com/conversion.h
ext/rpc/com/php_com.h
ext/rpc/com/php_variant.h
ext/rpc/com/variant.c
ext/rpc/dotnet/dotnet.cpp

index 943ed14a0d8fa2e558b1e67bcc290dc279557f60..7ab103d5df7d95b1d4140a2f846e31aa27a73335 100644 (file)
@@ -59,7 +59,7 @@
 #include <iostream.h>
 #include <math.h>
 
-extern "C" {
+extern "C" {   /* this should be included in the includes itself !! */
 
 #include "php.h"
 #include "php_ini.h"
@@ -67,12 +67,20 @@ extern "C" {
 }
 
 #include "conversion.h"
-#include "php_COM.h"
 #include "unknwn.h"
 
-static int le_idispatch;
+BEGIN_EXTERN_C()
+
+zend_class_entry com_class_entry;
 
-static zend_class_entry com_class_entry;
+END_EXTERN_C()
+
+PHP_FUNCTION(COM_load);
+PHP_FUNCTION(COM_invoke);
+PHP_FUNCTION(com_propget);
+PHP_FUNCTION(com_propput);
+
+static int le_idispatch;
 
 function_entry COM_functions[] = {
        PHP_FE(COM_load,                                                                NULL)
@@ -88,10 +96,6 @@ function_entry COM_functions[] = {
        {NULL, NULL, NULL}
 };
 
-__declspec(dllexport)
-int php_COM_get_le_idispatch() {
-       return le_idispatch;
-}
 
 static PHP_MINFO_FUNCTION(COM)
 {
@@ -100,8 +104,7 @@ static PHP_MINFO_FUNCTION(COM)
 
 static int php_COM_load_typelib(char *typelib_name, int mode);
 
-__declspec(dllexport)
-char *php_COM_error_message(HRESULT hr)
+PHPAPI char *php_COM_error_message(HRESULT hr)
 {
        char *pMsgBuf;
 
@@ -134,7 +137,6 @@ static void php_idispatch_destructor(zend_rsrc_list_entry *rsrc)
        i_dispatch->Release();
 }
 
-
 static PHP_INI_MH(OnTypelibFileChange)
 {
        FILE *typelib_file;
@@ -631,9 +633,7 @@ VARIANTARG _php_COM_get_property_handler(zend_property_reference *property_refer
        return var_result;
 }
 
-
-__declspec(dllexport)
-pval php_COM_get_property_handler(zend_property_reference *property_reference)
+PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_reference)
 {
        pval result;
        VARIANTARG var_result = _php_COM_get_property_handler(property_reference);
@@ -643,8 +643,7 @@ pval php_COM_get_property_handler(zend_property_reference *property_reference)
 }
 
 
-__declspec(dllexport)
-int php_COM_set_property_handler(zend_property_reference *property_reference, pval *value)
+PHPAPI int php_COM_set_property_handler(zend_property_reference *property_reference, pval *value)
 {
        pval result;
        zend_overloaded_element *overloaded_property;
@@ -707,8 +706,7 @@ int php_COM_set_property_handler(zend_property_reference *property_reference, pv
 
 
 
-__declspec(dllexport)
-void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference)
+PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference)
 {
        zend_overloaded_element *overloaded_property;
        pval *object = property_reference->object;
@@ -868,8 +866,17 @@ PHP_MSHUTDOWN_FUNCTION(COM)
        return SUCCESS;
 }
 
+BEGIN_EXTERN_C()
+// exports for external object creation
+
 zend_module_entry COM_module_entry = {
        "com", COM_functions, PHP_MINIT(COM), PHP_MSHUTDOWN(COM), NULL, NULL, PHP_MINFO(COM), STANDARD_MODULE_PROPERTIES
 };
 
+PHPAPI int php_COM_get_le_idispatch() {
+       return le_idispatch;
+}
+
+END_EXTERN_C()
+
 #endif
index 5afd1bdac60321af5553323d0a90bb6f500b47f3..36cc82c0e43afb8551d3d9fc0f0a4b0563665e76 100644 (file)
@@ -410,4 +410,4 @@ void php_register_VARIANT_class()
        zend_register_internal_class(&VARIANT_class_entry);
 }
 
-#endif
+#endif /* PHP_WIN32 */
index aa3af99d214b128cba1976267119c0fdf9926ea1..a0ef18cea52cc46a87151c15da5cade2c8126d39 100644 (file)
@@ -1,4 +1,7 @@
+#ifdef PHP_WIN32
+
 #include "php.h"
+#include "php_COM.h"
 
 #ifdef CP_THREAD_ACP
 #define PHP_UNICODE_CODEPAGE CP_THREAD_ACP
@@ -6,16 +9,17 @@
 #define PHP_UNICODE_CODEPAGE CP_ACP
 #endif
 
+// prototypes
 
-__declspec(dllexport) void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg);
-__declspec(dllexport) void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_type);
-__declspec(dllexport) void php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent); 
-__declspec(dllexport) OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen);
-__declspec(dllexport) char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int persistent);
+PHPAPI void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg);
+PHPAPI void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_type);
+PHPAPI void php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent); 
+PHPAPI OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen);
+PHPAPI char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int persistent);
 
+// implementations
 
-__declspec(dllexport)
-void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg)
+PHPAPI void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg)
 {
        OLECHAR *unicode_str;
 
@@ -68,7 +72,7 @@ void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg)
        }
 }
 
-__declspec(dllexport) void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_type)
+PHPAPI void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_type)
 {
        if(pval_type->type != IS_STRING)
        {
@@ -292,8 +296,7 @@ __declspec(dllexport) void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_a
        }
 }
 
-__declspec(dllexport)
-void php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent)
+PHPAPI void php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent)
 {
        
        switch (var_arg->vt & ~VT_BYREF) {
@@ -409,7 +412,7 @@ void php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent)
                                pval *handle;
 
                                pval_arg->type=IS_OBJECT;
-//                             pval_arg->value.obj.ce=&VARIANT_class_entry;
+                               pval_arg->value.obj.ce = &com_class_entry;
                                pval_arg->value.obj.properties = (HashTable *) emalloc(sizeof(HashTable));
                                pval_arg->is_ref=1;
                                pval_arg->refcount=1;
@@ -417,7 +420,7 @@ void php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent)
 
                                ALLOC_ZVAL(handle);
                                handle->type = IS_LONG;
-//                             handle->value.lval = zend_list_insert(var_arg->pdispVal, le_variant);
+                               handle->value.lval = zend_list_insert(var_arg->pdispVal, php_COM_get_le_idispatch());
                                pval_copy_constructor(handle);
                                INIT_PZVAL(handle);
                                zend_hash_index_update(pval_arg->value.obj.properties, 0, &handle, sizeof(pval *), NULL);
@@ -433,8 +436,7 @@ void php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent)
        }
 }
 
-__declspec(dllexport)
-OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen)
+PHPAPI OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen)
 {
        OLECHAR *unicode_str;
 
@@ -466,8 +468,7 @@ OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen)
        return unicode_str;
 }
 
-__declspec(dllexport)
-char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int persistent)
+PHPAPI char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int persistent)
 {
        char *C_str;
        uint length = 0;
@@ -495,3 +496,5 @@ char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int persistent
 
        return C_str;
 }
+
+#endif /* PHP_WIN32 */
\ No newline at end of file
index fc98827199878622e0a6da0c6d92ffc64d8c7b0c..a972b7759601c763317029bcbab91cce70b42258 100644 (file)
@@ -1,18 +1,14 @@
 #ifndef CONVERSION_H
 #define CONVERSION_H
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+BEGIN_EXTERN_C()
 
-void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg);
-void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_type);
-void php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent);
-OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen);
-char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int persistent);
+extern void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg);
+extern void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_type);
+extern void php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent);
+extern OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen);
+extern char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int persistent);
 
-#ifdef __cplusplus
-}
-#endif
+END_EXTERN_C()
 
 #endif
\ No newline at end of file
index c2d871fac6a07a17a1cc54490c915ad1802d3ea6..d2a680faff8b592372f78c952a20626e3cfc8437 100644 (file)
@@ -1,23 +1,27 @@
 #ifndef PHP_COM_H
 #define PHP_COM_H
 
-#if WIN32|WINNT
+#if PHP_WIN32
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+BEGIN_EXTERN_C()
 
 extern PHP_MINIT_FUNCTION(COM);
 extern PHP_MSHUTDOWN_FUNCTION(COM);
-PHP_FUNCTION(COM_load);
-PHP_FUNCTION(COM_invoke);
 
-PHP_FUNCTION(com_propget);
-PHP_FUNCTION(com_propput);
+extern int php_COM_get_le_idispatch();
+
 extern zend_module_entry COM_module_entry;
+extern zend_class_entry com_class_entry;
+
+END_EXTERN_C()
 
 #ifdef __cplusplus
-}
+
+extern pval php_COM_get_property_handler(zend_property_reference *property_reference);
+extern int php_COM_set_property_handler(zend_property_reference *property_reference, pval *value);
+extern char *php_COM_error_message(HRESULT hr);
+extern void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference);
+
 #endif
 
 #define COM_module_ptr &COM_module_entry
@@ -26,8 +30,6 @@ extern zend_module_entry COM_module_entry;
 
 #define COM_module_ptr NULL
 
-#endif  /* Win32|WINNT */
-
-#define phpext_COM_ptr COM_module_ptr
+#endif  /* PHP_WIN32 */
 
 #endif  /* PHP_COM_H */
index 2bb5fc1d62e207d1b03a75a8fe979f22977c3405..0382b88a64b40c8eec4f0d7ba8259409c0504886 100644 (file)
@@ -1,19 +1,20 @@
 #ifndef PHP_TYPEDEF_VARIANT_H
 #define PHP_TYPEDEF_VARIANT_H
 
-#if WIN32|WINNT
+#if PHP_WIN32
 
 extern PHP_MINIT_FUNCTION(VARIANT);
 extern PHP_MSHUTDOWN_FUNCTION(VARIANT);
 
 extern zend_module_entry VARIANT_module_entry;
+
 #define VARIANT_module_ptr &VARIANT_module_entry
 
 #else
 
 #define VARIANT_module_ptr NULL
 
-#endif  /* Win32|WINNT */
+#endif  /* PHP_WIN32 */
 
 #define phpext_VARIANT_ptr VARIANT_module_ptr
 
index 12326f1d5ef8cd6dd5a6a039b8fec044048390b8..f20c1f46dd495c9bc640ea76f9ce1477b66e3239 100644 (file)
 #include <math.h>
 #include <comdef.h>
 
-extern "C" {
+extern "C" {  /* this should be included in the includes itself !! */
+
 #include "php.h"
 #include "php_ini.h"
 
-OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen);
 }
 
-pval php_COM_get_property_handler(zend_property_reference *property_reference);
-int php_COM_set_property_handler(zend_property_reference *property_reference, pval *value);
-char *php_COM_error_message(HRESULT hr);
-void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference);
-int php_COM_get_le_idispatch();
-
 #include "../com/conversion.h"
+#include "../com/php_COM.h"
 #include "Mscoree.h"
 #include "mscorlib.h"
 
@@ -220,8 +215,8 @@ zend_module_entry dotnet_module_entry = {
        "dotnet", DOTNET_functions, PHP_MINIT(DOTNET), PHP_MSHUTDOWN(DOTNET), NULL, NULL, PHP_MINFO(DOTNET), STANDARD_MODULE_PROPERTIES
 };
 
-extern "C" {
-       ZEND_GET_MODULE(dotnet)
-}
+BEGIN_EXTERN_C()
+ZEND_GET_MODULE(dotnet)
+END_EXTERN_C()
 
 #endif
index 943ed14a0d8fa2e558b1e67bcc290dc279557f60..7ab103d5df7d95b1d4140a2f846e31aa27a73335 100644 (file)
@@ -59,7 +59,7 @@
 #include <iostream.h>
 #include <math.h>
 
-extern "C" {
+extern "C" {   /* this should be included in the includes itself !! */
 
 #include "php.h"
 #include "php_ini.h"
@@ -67,12 +67,20 @@ extern "C" {
 }
 
 #include "conversion.h"
-#include "php_COM.h"
 #include "unknwn.h"
 
-static int le_idispatch;
+BEGIN_EXTERN_C()
+
+zend_class_entry com_class_entry;
 
-static zend_class_entry com_class_entry;
+END_EXTERN_C()
+
+PHP_FUNCTION(COM_load);
+PHP_FUNCTION(COM_invoke);
+PHP_FUNCTION(com_propget);
+PHP_FUNCTION(com_propput);
+
+static int le_idispatch;
 
 function_entry COM_functions[] = {
        PHP_FE(COM_load,                                                                NULL)
@@ -88,10 +96,6 @@ function_entry COM_functions[] = {
        {NULL, NULL, NULL}
 };
 
-__declspec(dllexport)
-int php_COM_get_le_idispatch() {
-       return le_idispatch;
-}
 
 static PHP_MINFO_FUNCTION(COM)
 {
@@ -100,8 +104,7 @@ static PHP_MINFO_FUNCTION(COM)
 
 static int php_COM_load_typelib(char *typelib_name, int mode);
 
-__declspec(dllexport)
-char *php_COM_error_message(HRESULT hr)
+PHPAPI char *php_COM_error_message(HRESULT hr)
 {
        char *pMsgBuf;
 
@@ -134,7 +137,6 @@ static void php_idispatch_destructor(zend_rsrc_list_entry *rsrc)
        i_dispatch->Release();
 }
 
-
 static PHP_INI_MH(OnTypelibFileChange)
 {
        FILE *typelib_file;
@@ -631,9 +633,7 @@ VARIANTARG _php_COM_get_property_handler(zend_property_reference *property_refer
        return var_result;
 }
 
-
-__declspec(dllexport)
-pval php_COM_get_property_handler(zend_property_reference *property_reference)
+PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_reference)
 {
        pval result;
        VARIANTARG var_result = _php_COM_get_property_handler(property_reference);
@@ -643,8 +643,7 @@ pval php_COM_get_property_handler(zend_property_reference *property_reference)
 }
 
 
-__declspec(dllexport)
-int php_COM_set_property_handler(zend_property_reference *property_reference, pval *value)
+PHPAPI int php_COM_set_property_handler(zend_property_reference *property_reference, pval *value)
 {
        pval result;
        zend_overloaded_element *overloaded_property;
@@ -707,8 +706,7 @@ int php_COM_set_property_handler(zend_property_reference *property_reference, pv
 
 
 
-__declspec(dllexport)
-void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference)
+PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference)
 {
        zend_overloaded_element *overloaded_property;
        pval *object = property_reference->object;
@@ -868,8 +866,17 @@ PHP_MSHUTDOWN_FUNCTION(COM)
        return SUCCESS;
 }
 
+BEGIN_EXTERN_C()
+// exports for external object creation
+
 zend_module_entry COM_module_entry = {
        "com", COM_functions, PHP_MINIT(COM), PHP_MSHUTDOWN(COM), NULL, NULL, PHP_MINFO(COM), STANDARD_MODULE_PROPERTIES
 };
 
+PHPAPI int php_COM_get_le_idispatch() {
+       return le_idispatch;
+}
+
+END_EXTERN_C()
+
 #endif
index aa3af99d214b128cba1976267119c0fdf9926ea1..a0ef18cea52cc46a87151c15da5cade2c8126d39 100644 (file)
@@ -1,4 +1,7 @@
+#ifdef PHP_WIN32
+
 #include "php.h"
+#include "php_COM.h"
 
 #ifdef CP_THREAD_ACP
 #define PHP_UNICODE_CODEPAGE CP_THREAD_ACP
@@ -6,16 +9,17 @@
 #define PHP_UNICODE_CODEPAGE CP_ACP
 #endif
 
+// prototypes
 
-__declspec(dllexport) void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg);
-__declspec(dllexport) void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_type);
-__declspec(dllexport) void php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent); 
-__declspec(dllexport) OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen);
-__declspec(dllexport) char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int persistent);
+PHPAPI void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg);
+PHPAPI void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_type);
+PHPAPI void php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent); 
+PHPAPI OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen);
+PHPAPI char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int persistent);
 
+// implementations
 
-__declspec(dllexport)
-void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg)
+PHPAPI void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg)
 {
        OLECHAR *unicode_str;
 
@@ -68,7 +72,7 @@ void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg)
        }
 }
 
-__declspec(dllexport) void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_type)
+PHPAPI void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_type)
 {
        if(pval_type->type != IS_STRING)
        {
@@ -292,8 +296,7 @@ __declspec(dllexport) void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_a
        }
 }
 
-__declspec(dllexport)
-void php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent)
+PHPAPI void php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent)
 {
        
        switch (var_arg->vt & ~VT_BYREF) {
@@ -409,7 +412,7 @@ void php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent)
                                pval *handle;
 
                                pval_arg->type=IS_OBJECT;
-//                             pval_arg->value.obj.ce=&VARIANT_class_entry;
+                               pval_arg->value.obj.ce = &com_class_entry;
                                pval_arg->value.obj.properties = (HashTable *) emalloc(sizeof(HashTable));
                                pval_arg->is_ref=1;
                                pval_arg->refcount=1;
@@ -417,7 +420,7 @@ void php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent)
 
                                ALLOC_ZVAL(handle);
                                handle->type = IS_LONG;
-//                             handle->value.lval = zend_list_insert(var_arg->pdispVal, le_variant);
+                               handle->value.lval = zend_list_insert(var_arg->pdispVal, php_COM_get_le_idispatch());
                                pval_copy_constructor(handle);
                                INIT_PZVAL(handle);
                                zend_hash_index_update(pval_arg->value.obj.properties, 0, &handle, sizeof(pval *), NULL);
@@ -433,8 +436,7 @@ void php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent)
        }
 }
 
-__declspec(dllexport)
-OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen)
+PHPAPI OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen)
 {
        OLECHAR *unicode_str;
 
@@ -466,8 +468,7 @@ OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen)
        return unicode_str;
 }
 
-__declspec(dllexport)
-char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int persistent)
+PHPAPI char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int persistent)
 {
        char *C_str;
        uint length = 0;
@@ -495,3 +496,5 @@ char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int persistent
 
        return C_str;
 }
+
+#endif /* PHP_WIN32 */
\ No newline at end of file
index fc98827199878622e0a6da0c6d92ffc64d8c7b0c..a972b7759601c763317029bcbab91cce70b42258 100644 (file)
@@ -1,18 +1,14 @@
 #ifndef CONVERSION_H
 #define CONVERSION_H
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+BEGIN_EXTERN_C()
 
-void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg);
-void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_type);
-void php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent);
-OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen);
-char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int persistent);
+extern void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg);
+extern void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_type);
+extern void php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent);
+extern OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen);
+extern char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int persistent);
 
-#ifdef __cplusplus
-}
-#endif
+END_EXTERN_C()
 
 #endif
\ No newline at end of file
index c2d871fac6a07a17a1cc54490c915ad1802d3ea6..d2a680faff8b592372f78c952a20626e3cfc8437 100644 (file)
@@ -1,23 +1,27 @@
 #ifndef PHP_COM_H
 #define PHP_COM_H
 
-#if WIN32|WINNT
+#if PHP_WIN32
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+BEGIN_EXTERN_C()
 
 extern PHP_MINIT_FUNCTION(COM);
 extern PHP_MSHUTDOWN_FUNCTION(COM);
-PHP_FUNCTION(COM_load);
-PHP_FUNCTION(COM_invoke);
 
-PHP_FUNCTION(com_propget);
-PHP_FUNCTION(com_propput);
+extern int php_COM_get_le_idispatch();
+
 extern zend_module_entry COM_module_entry;
+extern zend_class_entry com_class_entry;
+
+END_EXTERN_C()
 
 #ifdef __cplusplus
-}
+
+extern pval php_COM_get_property_handler(zend_property_reference *property_reference);
+extern int php_COM_set_property_handler(zend_property_reference *property_reference, pval *value);
+extern char *php_COM_error_message(HRESULT hr);
+extern void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference);
+
 #endif
 
 #define COM_module_ptr &COM_module_entry
@@ -26,8 +30,6 @@ extern zend_module_entry COM_module_entry;
 
 #define COM_module_ptr NULL
 
-#endif  /* Win32|WINNT */
-
-#define phpext_COM_ptr COM_module_ptr
+#endif  /* PHP_WIN32 */
 
 #endif  /* PHP_COM_H */
index 2bb5fc1d62e207d1b03a75a8fe979f22977c3405..0382b88a64b40c8eec4f0d7ba8259409c0504886 100644 (file)
@@ -1,19 +1,20 @@
 #ifndef PHP_TYPEDEF_VARIANT_H
 #define PHP_TYPEDEF_VARIANT_H
 
-#if WIN32|WINNT
+#if PHP_WIN32
 
 extern PHP_MINIT_FUNCTION(VARIANT);
 extern PHP_MSHUTDOWN_FUNCTION(VARIANT);
 
 extern zend_module_entry VARIANT_module_entry;
+
 #define VARIANT_module_ptr &VARIANT_module_entry
 
 #else
 
 #define VARIANT_module_ptr NULL
 
-#endif  /* Win32|WINNT */
+#endif  /* PHP_WIN32 */
 
 #define phpext_VARIANT_ptr VARIANT_module_ptr
 
index 5afd1bdac60321af5553323d0a90bb6f500b47f3..36cc82c0e43afb8551d3d9fc0f0a4b0563665e76 100644 (file)
@@ -410,4 +410,4 @@ void php_register_VARIANT_class()
        zend_register_internal_class(&VARIANT_class_entry);
 }
 
-#endif
+#endif /* PHP_WIN32 */
index 12326f1d5ef8cd6dd5a6a039b8fec044048390b8..f20c1f46dd495c9bc640ea76f9ce1477b66e3239 100644 (file)
 #include <math.h>
 #include <comdef.h>
 
-extern "C" {
+extern "C" {  /* this should be included in the includes itself !! */
+
 #include "php.h"
 #include "php_ini.h"
 
-OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen);
 }
 
-pval php_COM_get_property_handler(zend_property_reference *property_reference);
-int php_COM_set_property_handler(zend_property_reference *property_reference, pval *value);
-char *php_COM_error_message(HRESULT hr);
-void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference);
-int php_COM_get_le_idispatch();
-
 #include "../com/conversion.h"
+#include "../com/php_COM.h"
 #include "Mscoree.h"
 #include "mscorlib.h"
 
@@ -220,8 +215,8 @@ zend_module_entry dotnet_module_entry = {
        "dotnet", DOTNET_functions, PHP_MINIT(DOTNET), PHP_MSHUTDOWN(DOTNET), NULL, NULL, PHP_MINFO(DOTNET), STANDARD_MODULE_PROPERTIES
 };
 
-extern "C" {
-       ZEND_GET_MODULE(dotnet)
-}
+BEGIN_EXTERN_C()
+ZEND_GET_MODULE(dotnet)
+END_EXTERN_C()
 
 #endif