-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix build with master #13
Conversation
PHP_USTRING_API void php_ustring_construct(zval *that, const char *value, zend_size_t len, const char *codepage, zend_size_t clen TSRMLS_DC); | ||
PHP_USTRING_API zend_size_t php_ustring_length(zval *that TSRMLS_DC); | ||
PHP_USTRING_API void php_ustring_construct(zval *that, const char *value, size_t len, const char *codepage, size_t clen TSRMLS_DC); | ||
PHP_USTRING_API size_t php_ustring_length(zval *that TSRMLS_DC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation borked.
Conflicts: api.h backend/api.h backend/icu.cpp ustring.cpp
@TazeTSchnitzel thanks, had to merge with the origin anyway as i was too late for two hours :) Should be fine now. |
@@ -22,6 +22,8 @@ | |||
#include "config.h" | |||
#endif | |||
|
|||
#include "unicode/unistr.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't include this here, it has to be in backend only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately it needs to be here, otherwise it causes linking issues on Windows. IMHO cleaner were even not to include a cpp file, but add it to the compiler separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be here, only #ifdef'ed
On Aug 27, 2014 6:38 AM, "Joe Watkins" notifications@github.com wrote:
In ustring.cpp:
@@ -22,6 +22,8 @@
#include "config.h"
#endif+#include "unicode/unistr.h"
We can't include this here, it has to be in backend only.
—
Reply to this email directly or view it on GitHub
https://github.com/krakjoe/ustring/pull/13/files#r16757160.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's okay for now I guess ... Liz intends to write a native windows api backend, when we have that we can tidy config.m4/w32, and this include I guess ..
Most of the code fixes proposed here have already been merged into |
@@ -379,7 +381,7 @@ PHP_METHOD(UString, getCodepage) { | |||
/* {{{ proto void UString::setDefaultCodepage(string codepage) */ | |||
PHP_METHOD(UString, setDefaultCodepage) { | |||
char *codepage = NULL; | |||
size_t clen = 0; | |||
int clen = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we using int for string length still ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, according to LXR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well ... I am well and truly confused ... I just opened my eyes ... maybe it's that ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, IMHO that is fine, many libraries don't support 64 bit length strings, so even we had size_t for all - there were many places to check for overflows. Anyway, this is what the current status is so it works with master.
Conflicts: api.h backend/api.h backend/icu.cpp ustring.cpp
refixed again, please take a look |
Thanks :) |
Also this part is an absolute no-go: /*
It just does what you tried to avoid, having backend specific code in The +#include "unicode/unistr.h" #ifdef ICU_ENABLED include "unicode/unistr.h"#endif But I somehow think that it won't be required anymore as nothing in On Wed, Aug 27, 2014 at 9:40 AM, Anatol Belski notifications@github.com
Pierre |
@krakjoe thanks for merging. I'd also say including a cpp file is something one shouldn't do. That might work or not with cpp, so better use the common way with separate objects and export headers. |
the include there is temporary, when more than one backend exists, configure will handle them and will handle the build too, so it will be built normally ... kinda difficult/pointless to test with one backend ... |
it can be temporary and correct, but including .cpp is a bad practice (or On Wed, Aug 27, 2014 at 11:14 AM, Joe Watkins notifications@github.com
Pierre |
@weltling could you bring config.w32 in line please |
@krakjoe, ah, you split it ... yep, gonna do that ) |
So far tests past on master/windows.