From: Marcus Boerger Date: Sat, 14 Dec 2002 19:53:20 +0000 (+0000) Subject: Fix build when mbstring is a shared module or dll under windows X-Git-Tag: PHP_5_0_dev_before_13561_fix~718 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=16694d350062ac994f98acdb4ab5073d541d77e0;p=php Fix build when mbstring is a shared module or dll under windows --- diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 8add5f0f6c..bb2c765134 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -58,7 +58,11 @@ #include "ext/standard/php_image.h" #include "ext/standard/info.h" -#ifdef HAVE_MBSTRING +#if defined(HAVE_MBSTRING) && !defined(COMPILE_DL_MBSTRING) +#define EXIF_USE_MBSTRING 1 +#endif + +#ifdef EXIF_USE_MBSTRING #include "ext/mbstring/mbstring.h" #endif @@ -126,7 +130,7 @@ ZEND_DECLARE_MODULE_GLOBALS(exif) ZEND_API ZEND_INI_MH(OnUpdateEncode) { -#ifdef HAVE_MBSTRING +#ifdef EXIF_USE_MBSTRING if (new_value && strlen(new_value) && !php_mb_check_encoding_list(new_value TSRMLS_CC)) { php_error_docref( NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value); return FAILURE; @@ -137,7 +141,7 @@ ZEND_API ZEND_INI_MH(OnUpdateEncode) ZEND_API ZEND_INI_MH(OnUpdateDecode) { -#ifdef HAVE_MBSTRING +#ifdef EXIF_USE_MBSTRING if (!php_mb_check_encoding_list(new_value TSRMLS_CC)) { php_error_docref( NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value); return FAILURE; @@ -2529,7 +2533,7 @@ static int exif_process_undefined(char **result, char *value, size_t byte_count /* {{{ exif_process_string_raw * Copy a string in Exif header to a character string returns length of allocated buffer if any. */ -#ifndef HAVE_MBSTRING +#ifndef EXIF_USE_MBSTRING static int exif_process_string_raw(char **result, char *value, size_t byte_count) { /* we cannot use strlcpy - here the problem is that we have to copy NUL * chars up to byte_count, we also have to add a single NUL character to @@ -2575,7 +2579,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP { int a; -#ifdef HAVE_MBSTRING +#ifdef EXIF_USE_MBSTRING char *decode; size_t len;; #endif @@ -2587,7 +2591,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP *pszEncoding = estrdup((const char*)szValuePtr); szValuePtr = szValuePtr+8; ByteCount -= 8; -#ifdef HAVE_MBSTRING +#ifdef EXIF_USE_MBSTRING /* First try to detect BOM: ZERO WIDTH NOBREAK SPACE (FEFF 16) * since we have no encoding support for the BOM yet we skip that. */ @@ -2620,7 +2624,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP *pszEncoding = estrdup((const char*)szValuePtr); szValuePtr = szValuePtr+8; ByteCount -= 8; -#ifdef HAVE_MBSTRING +#ifdef EXIF_USE_MBSTRING if (ImageInfo->motorola_intel) { *pszInfoPtr = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_jis, ImageInfo->decode_jis_be, &len TSRMLS_CC); } else { @@ -2659,7 +2663,7 @@ static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_fi xp_field->tag = tag; /* Copy the comment */ -#ifdef HAVE_MBSTRING +#ifdef EXIF_USE_MBSTRING /* What if MS supports big-endian with XP? */ /* if (ImageInfo->motorola_intel) { xp_field->value = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_unicode, ImageInfo->decode_unicode_be, &xp_field->size TSRMLS_CC);