Skip to content

Commit

Permalink
Merge pull request #13 from weltling/master
Browse files Browse the repository at this point in the history
Fix build with master
  • Loading branch information
krakjoe committed Aug 27, 2014
2 parents 574c90a + 40555c2 commit 1627ee5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
3 changes: 2 additions & 1 deletion config.m4
Expand Up @@ -9,6 +9,7 @@ if test "$PHP_USTRING" != "no"; then
PHP_SUBST(USTRING_SHARED_LIBADD)

PHP_REQUIRE_CXX()
PHP_ADD_LIBRARY(stdc++,,USTRING_SHARED_LIBADD)

PHP_NEW_EXTENSION(ustring, ustring.cpp, $ext_shared)
PHP_NEW_EXTENSION(ustring, ustring.cpp, $ext_shared,, -D__STDC_LIMIT_MACROS)
fi
16 changes: 10 additions & 6 deletions config.w32
Expand Up @@ -4,11 +4,15 @@ ARG_WITH("ustring", "whether to enable ustring support, path to ICU", "yes");

if (PHP_USTRING != "no") {
if (CHECK_LIB("icuuc.lib", "ustring", PHP_USTRING) &&
CHECK_HEADER_ADD_INCLUDE("unicode/utf.h", "CFLAGS_INTL")) {
CHECK_HEADER_ADD_INCLUDE("unicode/utf.h", "CFLAGS_USTRING")) {

EXTENSION("ustring", "ustring.cpp");

ADD_FLAG("LIBS_USTRING", "icudt.lib icuin.lib icuio.lib icule.lib iculx.lib icutu.lib icuuc.lib");
ADD_FLAG("CFLAGS_USTRING", "/EHsc /Zc:wchar_t /D__STDC_LIMIT_MACROS /DZEND_WIN32_FORCE_INLINE");

AC_DEFINE("HAVE_USTRING", 1, "Have ustring support");
} else {
WARNING("ustring not enabled; libraries and/or headers not found");
}
ADD_FLAG("LIBS_USTRING", "icudt.lib icuin.lib icuio.lib icule.lib iculx.lib icutu.lib icuuc.lib");
ADD_FLAG("CFLAGS_USTRING", "/EHsc /Zc:wchar_t");
var sources = "ustring.cpp";
AC_DEFINE("PHP_EXPORTS", 1);
EXTENSION("ustring", sources);
}
4 changes: 4 additions & 0 deletions ustring.cpp
Expand Up @@ -22,6 +22,10 @@
#include "config.h"
#endif

#ifdef _WIN32
#include "unicode/unistr.h"
#endif

extern "C" {
# include "php.h"
# include "php_ini.h"
Expand Down

0 comments on commit 1627ee5

Please sign in to comment.