Skip to content
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

Merged
merged 8 commits into from
Aug 27, 2014
Merged

Fix build with master #13

merged 8 commits into from
Aug 27, 2014

Conversation

weltling
Copy link
Collaborator

  • fixed identifiers, now after the renames in master passed
  • fixed windows build
  • fixed config.m4 with possible libstdc++ linkage bug

So far tests past on master/windows.

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);
Copy link
Collaborator

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
@weltling
Copy link
Collaborator Author

@TazeTSchnitzel thanks, had to merge with the origin anyway as i was too late for two hours :) Should be fine now.

datibbaw added a commit that referenced this pull request Aug 27, 2014
Ref: issue #13
@@ -22,6 +22,8 @@
#include "config.h"
#endif

#include "unicode/unistr.h"
Copy link
Owner

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.

Copy link
Collaborator Author

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.

Copy link
Contributor

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.

Copy link
Owner

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 ..

@datibbaw
Copy link
Collaborator

Most of the code fixes proposed here have already been merged into master; I didn't touch the config.* files, though.

@@ -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;
Copy link
Owner

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 ??

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, according to LXR

Copy link
Owner

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 ...

Copy link
Collaborator Author

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
@weltling
Copy link
Collaborator Author

refixed again, please take a look

krakjoe added a commit that referenced this pull request Aug 27, 2014
@krakjoe krakjoe merged commit 1627ee5 into krakjoe:master Aug 27, 2014
@krakjoe
Copy link
Owner

krakjoe commented Aug 27, 2014

Thanks :)

@pierrejoye
Copy link
Contributor

Also this part is an absolute no-go:

/*

  • Do some magical ifdef'ing maybe ?
    */
    #include "backend/icu.cpp"

It just does what you tried to avoid, having backend specific code in
ustring.cpp. A hpp should be created and used. It won't change what will be
linked with the final .so/dll but the .o(bj) for ustring will simply
include icu.o in this case, or better said, icu.cpp will be inlined in
ustring.cpp.

The

+#include "unicode/unistr.h"
If after using the include "icu.hpp" we still have linkers error for
ustring.o(bj), we can keep doing it. But it should be #ifdefed, not
for windows but if ICU is present and used. I suppose it will be part
of the configure options so something along this line could work:

#ifdef ICU_ENABLED

include "unicode/unistr.h"

#endif

But I somehow think that it won't be required anymore as nothing in
ustring.cpp relies on ICU APIs as far as I can see.

On Wed, Aug 27, 2014 at 9:40 AM, Anatol Belski notifications@github.com
wrote:

refixed again, please take a look


Reply to this email directly or view it on GitHub
#13 (comment).

Pierre

@pierrejoye | http://www.libgd.org

@weltling
Copy link
Collaborator Author

@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.

@krakjoe
Copy link
Owner

krakjoe commented Aug 27, 2014

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 ...

@pierrejoye
Copy link
Contributor

it can be temporary and correct, but including .cpp is a bad practice (or
.c for what matters) and introduces all kind of issues.

On Wed, Aug 27, 2014 at 11:14 AM, Joe Watkins notifications@github.com
wrote:

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 ...


Reply to this email directly or view it on GitHub
#13 (comment).

Pierre

@pierrejoye | http://www.libgd.org

@krakjoe
Copy link
Owner

krakjoe commented Aug 27, 2014

@weltling could you bring config.w32 in line please

@weltling
Copy link
Collaborator Author

@krakjoe, ah, you split it ... yep, gonna do that )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants