diff options
author | Jose <jose@zeroc.com> | 2014-10-13 22:36:50 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2014-10-13 22:36:50 +0200 |
commit | 0402bdc5b5a7848fc0eab53fe6ae1b12df487a49 (patch) | |
tree | 5e61722a047577bb245bc39300d8250514672b60 /php/src | |
parent | updating CHANGES for AsyncResult.cancel (diff) | |
download | ice-0402bdc5b5a7848fc0eab53fe6ae1b12df487a49.tar.bz2 ice-0402bdc5b5a7848fc0eab53fe6ae1b12df487a49.tar.xz ice-0402bdc5b5a7848fc0eab53fe6ae1b12df487a49.zip |
Fixed (ICE-5710) - Source support for PHP x64 on Windows
Diffstat (limited to 'php/src')
-rw-r--r-- | php/src/IcePHP/Communicator.cpp | 12 | ||||
-rw-r--r-- | php/src/IcePHP/Config.h | 4 | ||||
-rw-r--r-- | php/src/IcePHP/Connection.cpp | 2 | ||||
-rw-r--r-- | php/src/IcePHP/Endpoint.cpp | 2 | ||||
-rw-r--r-- | php/src/IcePHP/Makefile.mak | 8 | ||||
-rw-r--r-- | php/src/IcePHP/Operation.cpp | 2 | ||||
-rw-r--r-- | php/src/IcePHP/Properties.cpp | 6 | ||||
-rw-r--r-- | php/src/IcePHP/Proxy.cpp | 8 | ||||
-rw-r--r-- | php/src/IcePHP/Types.cpp | 32 | ||||
-rw-r--r-- | php/src/IcePHP/Util.cpp | 17 |
10 files changed, 52 insertions, 41 deletions
diff --git a/php/src/IcePHP/Communicator.cpp b/php/src/IcePHP/Communicator.cpp index 8953aeeba9e..87efc6848ff 100644 --- a/php/src/IcePHP/Communicator.cpp +++ b/php/src/IcePHP/Communicator.cpp @@ -270,7 +270,7 @@ ZEND_METHOD(Ice_Communicator, proxyToString) assert(prx); str = prx->ice_toString(); } - RETURN_STRINGL(STRCAST(str.c_str()), str.length(), 1); + RETURN_STRINGL(STRCAST(str.c_str()), static_cast<int>(str.length()), 1); } catch(const IceUtil::Exception& ex) { @@ -403,7 +403,7 @@ ZEND_METHOD(Ice_Communicator, identityToString) try { string str = _this->getCommunicator()->identityToString(id); - RETURN_STRINGL(STRCAST(str.c_str()), str.length(), 1); + RETURN_STRINGL(STRCAST(str.c_str()), static_cast<int>(str.length()), 1); } catch(const IceUtil::Exception& ex) { @@ -897,7 +897,7 @@ ZEND_FUNCTION(Ice_initialize) string member; member = "properties"; - if(zend_hash_find(Z_OBJPROP_P(zvinit), STRCAST(member.c_str()), member.size() + 1, &data) == SUCCESS) + if(zend_hash_find(Z_OBJPROP_P(zvinit), STRCAST(member.c_str()), static_cast<uint>(member.size() + 1), &data) == SUCCESS) { zval** val = reinterpret_cast<zval**>(data); if(!fetchProperties(*val, initData.properties TSRMLS_CC)) @@ -907,7 +907,7 @@ ZEND_FUNCTION(Ice_initialize) } member = "logger"; - if(zend_hash_find(Z_OBJPROP_P(zvinit), STRCAST(member.c_str()), member.size() + 1, &data) == SUCCESS) + if(zend_hash_find(Z_OBJPROP_P(zvinit), STRCAST(member.c_str()), static_cast<uint>(member.size() + 1), &data) == SUCCESS) { zval** val = reinterpret_cast<zval**>(data); if(!fetchLogger(*val, initData.logger TSRMLS_CC)) @@ -1627,14 +1627,14 @@ IcePHP::ObjectFactoryI::create(const string& id) { zval* arg; MAKE_STD_ZVAL(arg); - ZVAL_STRINGL(arg, STRCAST(id.c_str()), id.length(), 1); + ZVAL_STRINGL(arg, STRCAST(id.c_str()), static_cast<int>(id.length()), 1); zval* obj = 0; zend_try { const char* func = "create"; - zend_call_method(&factory, 0, 0, const_cast<char*>(func), strlen(func), &obj, 1, arg, 0 TSRMLS_CC); + zend_call_method(&factory, 0, 0, const_cast<char*>(func), static_cast<int>(strlen(func)), &obj, 1, arg, 0 TSRMLS_CC); } zend_catch { diff --git a/php/src/IcePHP/Config.h b/php/src/IcePHP/Config.h index fa8130a1df0..94fd0a59b25 100644 --- a/php/src/IcePHP/Config.h +++ b/php/src/IcePHP/Config.h @@ -42,6 +42,10 @@ extern "C" # pragma GCC diagnostic warning "-Wsign-compare" #endif +#ifdef _WIN64 +# pragma warning( disable : 4267) // suppress size_t/uint conversion warnings in zend macros for Windows x64 builds +#endif + #if defined(__GNUC__) # pragma GCC diagnostic warning "-Wnarrowing" #endif diff --git a/php/src/IcePHP/Connection.cpp b/php/src/IcePHP/Connection.cpp index 899b442af02..5e030e8144c 100644 --- a/php/src/IcePHP/Connection.cpp +++ b/php/src/IcePHP/Connection.cpp @@ -61,7 +61,7 @@ ZEND_METHOD(Ice_Connection, __toString) try { string str = _this->toString(); - RETURN_STRINGL(STRCAST(str.c_str()), str.length(), 1); + RETURN_STRINGL(STRCAST(str.c_str()), static_cast<int>(str.length()), 1); } catch(const IceUtil::Exception& ex) { diff --git a/php/src/IcePHP/Endpoint.cpp b/php/src/IcePHP/Endpoint.cpp index 5a1599fe972..45f1a540055 100644 --- a/php/src/IcePHP/Endpoint.cpp +++ b/php/src/IcePHP/Endpoint.cpp @@ -60,7 +60,7 @@ ZEND_METHOD(Ice_Endpoint, __toString) try { string str = _this->toString(); - RETURN_STRINGL(STRCAST(str.c_str()), str.length(), 1); + RETURN_STRINGL(STRCAST(str.c_str()), static_cast<int>(str.length()), 1); } catch(const IceUtil::Exception& ex) { diff --git a/php/src/IcePHP/Makefile.mak b/php/src/IcePHP/Makefile.mak index 0f6cf07bd5e..977dbc0a866 100644 --- a/php/src/IcePHP/Makefile.mak +++ b/php/src/IcePHP/Makefile.mak @@ -27,7 +27,11 @@ OBJS = .\Communicator.obj \ !include $(top_srcdir)\config\Make.rules.mak.php -CPPFLAGS = -I. -I.. $(CPPFLAGS) $(ICE_CPPFLAGS) $(PHP_CPPFLAGS) -D_USE_32BIT_TIME_T +CPPFLAGS = -I. -I.. $(CPPFLAGS) $(ICE_CPPFLAGS) $(PHP_CPPFLAGS) + +!if "$(ARCH)" == "x86" +CPPFLAGS = $(CPPFLAGS) -D_USE_32BIT_TIME_T +!endif !if "$(OPTIMIZE)" != "yes" PDBFLAGS = /pdb:$(LIBNAME:.lib=.pdb) @@ -38,7 +42,7 @@ LINKWITH = $(ICE_LIBS) $(PHP_LIBS) $(CXXLIBS) $(LIBNAME): $(DLLNAME) $(DLLNAME): $(OBJS) IcePHP.res - $(LINK) $(ICE_LDFLAGS) $(PHP_LDFLAGS) $(LD_DLLFLAGS) $(PDBFLAGS) /export:get_module $(OBJS) \ + $(LINK) $(ICE_LDFLAGS) $(PHP_LDFLAGS) $(LD_DLLFLAGS) $(PDBFLAGS) $(OBJS) \ $(PREOUT)$(DLLNAME) $(PRELIBS)$(LINKWITH) IcePHP.res move $(DLLNAME:.dll=.lib) $(LIBNAME) diff --git a/php/src/IcePHP/Operation.cpp b/php/src/IcePHP/Operation.cpp index 7bcea3e131e..8e6e2f21753 100644 --- a/php/src/IcePHP/Operation.cpp +++ b/php/src/IcePHP/Operation.cpp @@ -345,7 +345,7 @@ IcePHP::OperationI::function() string fixed = fixIdent(name); _zendFunction = static_cast<zend_internal_function*>(emalloc(sizeof(zend_internal_function))); _zendFunction->type = ZEND_INTERNAL_FUNCTION; - _zendFunction->function_name = estrndup(STRCAST(fixed.c_str()), fixed.length()); + _zendFunction->function_name = estrndup(STRCAST(fixed.c_str()), static_cast<zend_uint>(fixed.length())); _zendFunction->scope = proxyClassEntry; _zendFunction->fn_flags = ZEND_ACC_PUBLIC; _zendFunction->prototype = 0; diff --git a/php/src/IcePHP/Properties.cpp b/php/src/IcePHP/Properties.cpp index b1ab29f21a1..f55fc59cc55 100644 --- a/php/src/IcePHP/Properties.cpp +++ b/php/src/IcePHP/Properties.cpp @@ -62,7 +62,7 @@ ZEND_METHOD(Ice_Properties, __toString) } str.append(p->first + "=" + p->second); } - RETURN_STRINGL(STRCAST(str.c_str()), str.length(), 1); + RETURN_STRINGL(STRCAST(str.c_str()), static_cast<int>(str.length()), 1); } catch(const IceUtil::Exception& ex) { @@ -88,7 +88,7 @@ ZEND_METHOD(Ice_Properties, getProperty) try { string val = _this->getProperty(propName); - RETURN_STRINGL(STRCAST(val.c_str()), val.length(), 1); + RETURN_STRINGL(STRCAST(val.c_str()), static_cast<int>(val.length()), 1); } catch(const IceUtil::Exception& ex) { @@ -123,7 +123,7 @@ ZEND_METHOD(Ice_Properties, getPropertyWithDefault) try { string val = _this->getPropertyWithDefault(propName, defaultValue); - RETURN_STRINGL(STRCAST(val.c_str()), val.length(), 1); + RETURN_STRINGL(STRCAST(val.c_str()), static_cast<int>(val.length()), 1); } catch(const IceUtil::Exception& ex) { diff --git a/php/src/IcePHP/Proxy.cpp b/php/src/IcePHP/Proxy.cpp index cd657468b3a..5706d46d7ce 100644 --- a/php/src/IcePHP/Proxy.cpp +++ b/php/src/IcePHP/Proxy.cpp @@ -117,7 +117,7 @@ ZEND_METHOD(Ice_ObjectPrx, __toString) try { string str = _this->proxy->ice_toString(); - RETURN_STRINGL(STRCAST(str.c_str()), str.length(), 1); + RETURN_STRINGL(STRCAST(str.c_str()), static_cast<int>(str.length()), 1); } catch(const IceUtil::Exception& ex) { @@ -254,7 +254,7 @@ ZEND_METHOD(Ice_ObjectPrx, ice_getFacet) try { string facet = _this->proxy->ice_getFacet(); - ZVAL_STRINGL(return_value, STRCAST(facet.c_str()), facet.length(), 1); + ZVAL_STRINGL(return_value, STRCAST(facet.c_str()), static_cast<int>(facet.length()), 1); } catch(const IceUtil::Exception& ex) { @@ -303,7 +303,7 @@ ZEND_METHOD(Ice_ObjectPrx, ice_getAdapterId) try { string id = _this->proxy->ice_getAdapterId(); - ZVAL_STRINGL(return_value, STRCAST(id.c_str()), id.length(), 1); + ZVAL_STRINGL(return_value, STRCAST(id.c_str()), static_cast<int>(id.length()), 1); } catch(const IceUtil::Exception& ex) { @@ -463,7 +463,7 @@ ZEND_METHOD(Ice_ObjectPrx, ice_getConnectionId) try { string connectionId = _this->proxy->ice_getConnectionId(); - ZVAL_STRINGL(return_value, STRCAST(connectionId.c_str()), connectionId.length(), 1); + ZVAL_STRINGL(return_value, STRCAST(connectionId.c_str()), static_cast<int>(connectionId.length()), 1); } catch(const IceUtil::Exception& ex) { diff --git a/php/src/IcePHP/Types.cpp b/php/src/IcePHP/Types.cpp index 202f2d785f4..b18a43da4de 100644 --- a/php/src/IcePHP/Types.cpp +++ b/php/src/IcePHP/Types.cpp @@ -356,7 +356,7 @@ IcePHP::SlicedDataUtil::setMember(zval* obj, const Ice::SlicedDataPtr& slicedDat zval* typeId; MAKE_STD_ZVAL(typeId); AutoDestroy typeIdDestroyer(typeId); - ZVAL_STRINGL(typeId, STRCAST((*p)->typeId.c_str()), (*p)->typeId.size(), 1); + ZVAL_STRINGL(typeId, STRCAST((*p)->typeId.c_str()), static_cast<int>((*p)->typeId.size()), 1); if(add_property_zval(slice, STRCAST("typeId"), typeId) != SUCCESS) { throw AbortMarshaling(); @@ -996,7 +996,7 @@ IcePHP::PrimitiveInfo::unmarshal(const Ice::InputStreamPtr& is, const UnmarshalC if(sizeof(Ice::Long) > sizeof(long) && (val < LONG_MIN || val > LONG_MAX)) { string str = IceUtilInternal::int64ToString(val); - ZVAL_STRINGL(zv, STRCAST(str.c_str()), str.length(), 1); + ZVAL_STRINGL(zv, STRCAST(str.c_str()), static_cast<int>(str.length()), 1); } else { @@ -1022,7 +1022,7 @@ IcePHP::PrimitiveInfo::unmarshal(const Ice::InputStreamPtr& is, const UnmarshalC { string val; is->read(val); - ZVAL_STRINGL(zv, STRCAST(val.c_str()), val.length(), 1); + ZVAL_STRINGL(zv, STRCAST(val.c_str()), static_cast<int>(val.length()), 1); break; } } @@ -1967,7 +1967,7 @@ IcePHP::SequenceInfo::unmarshalPrimitiveSequence(const PrimitiveInfoPtr& pi, con if(sizeof(Ice::Long) > sizeof(long) && (*p < LONG_MIN || *p > LONG_MAX)) { string str = IceUtilInternal::int64ToString(*p); - ZVAL_STRINGL(val, STRCAST(str.c_str()), str.length(), 1); + ZVAL_STRINGL(val, STRCAST(str.c_str()), static_cast<int>(str.length()), 1); } else { @@ -2016,7 +2016,7 @@ IcePHP::SequenceInfo::unmarshalPrimitiveSequence(const PrimitiveInfoPtr& pi, con { zval* val; MAKE_STD_ZVAL(val); - ZVAL_STRINGL(val, STRCAST(p->c_str()), p->length(), 1); + ZVAL_STRINGL(val, STRCAST(p->c_str()), static_cast<int>(p->length()), 1); add_index_zval(zv, i, val); } break; @@ -2903,7 +2903,7 @@ void IcePHP::ObjectWriter::ice_preMarshal() { string name = "ice_premarshal"; // Must be lowercase. - if(zend_hash_exists(&Z_OBJCE_P(_object)->function_table, STRCAST(name.c_str()), name.size() + 1)) + if(zend_hash_exists(&Z_OBJCE_P(_object)->function_table, STRCAST(name.c_str()), static_cast<uint>(name.size() + 1))) { if(!invokeMethod(_object, name TSRMLS_CC)) { @@ -2956,8 +2956,8 @@ IcePHP::ObjectWriter::writeMembers(const Ice::OutputStreamPtr& os, const DataMem DataMemberPtr member = *q; void* data; - if(zend_hash_find(Z_OBJPROP_P(_object), STRCAST(member->name.c_str()), member->name.size() + 1, &data) == - FAILURE) + if(zend_hash_find(Z_OBJPROP_P(_object), + STRCAST(member->name.c_str()), static_cast<int>(member->name.size() + 1), &data) == FAILURE) { runtimeError("member `%s' of %s is not defined" TSRMLS_CC, member->name.c_str(), _info->id.c_str()); throw AbortMarshaling(); @@ -3004,7 +3004,7 @@ void IcePHP::ObjectReader::ice_postUnmarshal() { string name = "ice_postunmarshal"; // Must be lowercase. - if(zend_hash_exists(&Z_OBJCE_P(_object)->function_table, STRCAST(name.c_str()), name.size() + 1)) + if(zend_hash_exists(&Z_OBJCE_P(_object)->function_table, STRCAST(name.c_str()), static_cast<int>(name.size() + 1))) { if(!invokeMethod(_object, name TSRMLS_CC)) { @@ -3083,7 +3083,7 @@ IcePHP::ObjectReader::read(const Ice::InputStreamPtr& is) zval* zv; MAKE_STD_ZVAL(zv); AutoDestroy typeIdDestroyer(zv); - ZVAL_STRINGL(zv, STRCAST(typeId.c_str()), typeId.size(), 1); + ZVAL_STRINGL(zv, STRCAST(typeId.c_str()), static_cast<int>(typeId.size()), 1); add_property_zval(_object, STRCAST("unknownTypeId"), zv); } } @@ -3274,7 +3274,8 @@ IcePHP::ExceptionInfo::printMembers(zval* zv, IceUtilInternal::Output& out, Prin out << nl << member->name << " = "; void* data; - if(zend_hash_find(Z_OBJPROP_P(zv), STRCAST(member->name.c_str()), member->name.size() + 1, &data) == SUCCESS) + if(zend_hash_find(Z_OBJPROP_P(zv), STRCAST(member->name.c_str()), static_cast<int>(member->name.size() + 1), + &data) == SUCCESS) { zval** val = reinterpret_cast<zval**>(data); member->type->print(*val, out, history TSRMLS_CC); @@ -3291,7 +3292,8 @@ IcePHP::ExceptionInfo::printMembers(zval* zv, IceUtilInternal::Output& out, Prin out << nl << member->name << " = "; void* data; - if(zend_hash_find(Z_OBJPROP_P(zv), STRCAST(member->name.c_str()), member->name.size() + 1, &data) == SUCCESS) + if(zend_hash_find(Z_OBJPROP_P(zv), STRCAST(member->name.c_str()), static_cast<int>(member->name.size() + 1), + &data) == SUCCESS) { zval** val = reinterpret_cast<zval**>(data); if(isUnset(*val TSRMLS_CC)) @@ -3803,7 +3805,7 @@ ZEND_FUNCTION(IcePHP_stringify) type->print(v, out, &history TSRMLS_CC); string str = ostr.str(); - RETURN_STRINGL(STRCAST(str.c_str()), str.length(), 1); + RETURN_STRINGL(STRCAST(str.c_str()), static_cast<int>(str.length()), 1); } ZEND_FUNCTION(IcePHP_stringifyException) @@ -3829,7 +3831,7 @@ ZEND_FUNCTION(IcePHP_stringifyException) ex->print(v, out TSRMLS_CC); string str = ostr.str(); - RETURN_STRINGL(STRCAST(str.c_str()), str.length(), 1); + RETURN_STRINGL(STRCAST(str.c_str()), static_cast<int>(str.length()), 1); } // @@ -3937,7 +3939,7 @@ IcePHP::typesRequestInit(TSRMLS_D) zval* unset; MAKE_STD_ZVAL(unset); - ZVAL_STRINGL(unset, STRCAST(_unsetGUID.c_str()), _unsetGUID.length(), 1); + ZVAL_STRINGL(unset, STRCAST(_unsetGUID.c_str()), static_cast<int>(_unsetGUID.length()), 1); ICE_G(unset) = unset; return true; diff --git a/php/src/IcePHP/Util.cpp b/php/src/IcePHP/Util.cpp index 1cc3c9e5c65..5a155a2f75b 100644 --- a/php/src/IcePHP/Util.cpp +++ b/php/src/IcePHP/Util.cpp @@ -147,7 +147,7 @@ versionToString(zval* zv, zval* s, const char* type TSRMLS_DC) try { string str = IceInternal::versionToString<T>(v); - ZVAL_STRINGL(s, STRCAST(str.c_str()), str.length(), 1); + ZVAL_STRINGL(s, STRCAST(str.c_str()), static_cast<int>(str.length()), 1); } catch(const IceUtil::Exception& ex) { @@ -247,7 +247,7 @@ zend_class_entry* IcePHP::nameToClass(const string& name TSRMLS_DC) { zend_class_entry** result; - if(zend_lookup_class(STRCAST(name.c_str()), name.length(), &result TSRMLS_CC) == FAILURE) + if(zend_lookup_class(STRCAST(name.c_str()), static_cast<int>(name.length()), &result TSRMLS_CC) == FAILURE) { return 0; } @@ -323,7 +323,8 @@ IcePHP::createStringMap(zval* zv, const map<string, string>& ctx TSRMLS_DC) for(map<string, string>::const_iterator p = ctx.begin(); p != ctx.end(); ++p) { if(add_assoc_stringl_ex(zv, const_cast<char*>(p->first.c_str()), p->first.length() + 1, - const_cast<char*>(p->second.c_str()), p->second.length(), 1) == FAILURE) + const_cast<char*>(p->second.c_str()), + static_cast<uint>(p->second.length()), 1) == FAILURE) { return false; } @@ -388,7 +389,7 @@ IcePHP::createStringArray(zval* zv, const Ice::StringSeq& seq TSRMLS_DC) array_init(zv); for(Ice::StringSeq::const_iterator p = seq.begin(); p != seq.end(); ++p) { - if(add_next_index_stringl(zv, STRCAST(p->c_str()), p->length(), 1) == FAILURE) + if(add_next_index_stringl(zv, STRCAST(p->c_str()), static_cast<uint>(p->length()), 1) == FAILURE) { return false; } @@ -758,7 +759,7 @@ throwError(const string& name, const string& msg TSRMLS_DC) zend_class_entry* cls; { zend_class_entry** p; - if(zend_lookup_class(STRCAST(name.c_str()), name.size(), &p TSRMLS_CC) == FAILURE) + if(zend_lookup_class(STRCAST(name.c_str()), static_cast<int>(name.size()), &p TSRMLS_CC) == FAILURE) { assert(false); } @@ -867,7 +868,7 @@ IcePHP::invokeMethod(zval* obj, const string& name, const string& arg TSRMLS_DC) { zval* param; MAKE_STD_ZVAL(param); - ZVAL_STRINGL(param, STRCAST(arg.c_str()), arg.size(), 1); + ZVAL_STRINGL(param, STRCAST(arg.c_str()), static_cast<int>(arg.size()), 1); AutoDestroy destroy(param); return invokeMethodHelper(obj, name, param TSRMLS_CC); } @@ -903,7 +904,7 @@ ZEND_FUNCTION(Ice_stringVersion) WRONG_PARAM_COUNT; } - RETURN_STRINGL(STRCAST(ICE_STRING_VERSION), strlen(ICE_STRING_VERSION), 1); + RETURN_STRINGL(STRCAST(ICE_STRING_VERSION), static_cast<int>(strlen(ICE_STRING_VERSION)), 1); } ZEND_FUNCTION(Ice_intVersion) @@ -924,7 +925,7 @@ ZEND_FUNCTION(Ice_generateUUID) } string uuid = IceUtil::generateUUID(); - RETURN_STRINGL(STRCAST(uuid.c_str()), uuid.size(), 1); + RETURN_STRINGL(STRCAST(uuid.c_str()), static_cast<int>(uuid.size()), 1); } ZEND_FUNCTION(Ice_currentProtocol) |