Browse Source

- fix build where mhash.h is not declaring

mhash_get_hash_name_static and/or
  mhash_get_keygen_name_static protos
PHAR_1_2
Michael Wallner 19 years ago
parent
commit
4e35f60f71
  1. 14
      ext/mhash/config.m4
  2. 4
      ext/mhash/mhash.c

14
ext/mhash/config.m4

@ -13,6 +13,20 @@ if test "$PHP_MHASH" != "no"; then
if test -z "$MHASH_DIR"; then
AC_MSG_ERROR(Please reinstall libmhash - I cannot find mhash.h)
fi
PHP_MHASH_MISSING_PROTOS=
AC_MSG_CHECKING(for missing protos)
AC_EGREP_HEADER(mhash_get_hash_name_static, [$MHASH_DIR/include/mhash.h], [
AC_DEFINE([HAVE_MHASH_GET_HASH_NAME_STATIC_PROTO], 1, [ ])
], [
PHP_MHASH_MISSING_PROTOS="mhash_get_hash_name_static"
])
AC_EGREP_HEADER(mhash_get_keygen_name_static, [$MHASH_DIR/include/mhash.h], [
AC_DEFINE([HAVE_MHASH_GET_KEYGEN_NAME_STATIC_PROTO], 1, [ ])
], [
PHP_MHASH_MISSING_PROTOS="mhash_get_keygen_name_static $PHP_MHASH_MISSING_PROTOS"
])
AC_MSG_RESULT([$PHP_MHASH_MISSING_PROTOS])
PHP_ADD_INCLUDE($MHASH_DIR/include)
PHP_ADD_LIBRARY_WITH_PATH(mhash, $MHASH_DIR/$PHP_LIBDIR, MHASH_SHARED_LIBADD)

4
ext/mhash/mhash.c

@ -65,8 +65,12 @@ ZEND_GET_MODULE(mhash)
#define NO_ARGS() (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ""))
#ifndef HAVE_MHASH_GET_HASH_NAME_STATIC_PROTO
extern const char *mhash_get_hash_name_static(hashid hash);
#endif
#ifndef HAVE_MHASH_GET_KEYGEN_NAME_STATIC_PROTO
extern const char *mhash_get_keygen_name_static(hashid type);
#endif
/* {{{ int php_mhash */
int php_mhash(hashid hash, const char *input_str, int input_len, const char *key_str, int key_len, char **enc, int *len TSRMLS_DC)

Loading…
Cancel
Save