Skip to content

Commit

Permalink
cleanup the mod version macros, round 2
Browse files Browse the repository at this point in the history
  • Loading branch information
weltling committed Mar 23, 2015
1 parent ec89c85 commit 2d78023
Show file tree
Hide file tree
Showing 33 changed files with 57 additions and 34 deletions.
2 changes: 1 addition & 1 deletion ext/gd/gd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ zend_module_entry gd_module_entry = {
NULL,
#endif
PHP_MINFO(gd),
NO_VERSION_YET,
PHP_GD_VERSION,
STANDARD_MODULE_PROPERTIES
};

Expand Down
3 changes: 3 additions & 0 deletions ext/gd/php_gd.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ PHPAPI extern const char php_sig_png[8];
extern zend_module_entry gd_module_entry;
#define phpext_gd_ptr &gd_module_entry

#include "php_version.h"
#define PHP_GD_VERSION PHP_VERSION

/* gd.c functions */
PHP_MINFO_FUNCTION(gd);
PHP_MINIT_FUNCTION(gd);
Expand Down
2 changes: 1 addition & 1 deletion ext/gettext/gettext.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ zend_module_entry php_gettext_module_entry = {
NULL,
NULL,
PHP_MINFO(php_gettext),
NO_VERSION_YET,
PHP_GETTEXT_VERSION,
STANDARD_MODULE_PROPERTIES
};

Expand Down
3 changes: 3 additions & 0 deletions ext/gettext/php_gettext.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
extern zend_module_entry php_gettext_module_entry;
#define gettext_module_ptr &php_gettext_module_entry

#include "php_version.h"
#define PHP_GETTEXT_VERSION PHP_VERSION

PHP_MINFO_FUNCTION(php_gettext);

PHP_NAMED_FUNCTION(zif_textdomain);
Expand Down
2 changes: 1 addition & 1 deletion ext/gmp/gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ zend_module_entry gmp_module_entry = {
NULL,
ZEND_MODULE_DEACTIVATE_N(gmp),
ZEND_MODULE_INFO_N(gmp),
NO_VERSION_YET,
PHP_GMP_VERSION,
ZEND_MODULE_GLOBALS(gmp),
ZEND_GINIT(gmp),
NULL,
Expand Down
3 changes: 3 additions & 0 deletions ext/gmp/php_gmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
extern zend_module_entry gmp_module_entry;
#define phpext_gmp_ptr &gmp_module_entry

#include "php_version.h"
#define PHP_GMP_VERSION PHP_VERSION

ZEND_MODULE_STARTUP_D(gmp);
ZEND_MODULE_DEACTIVATE_D(gmp);
ZEND_MODULE_INFO_D(gmp);
Expand Down
8 changes: 2 additions & 6 deletions ext/hash/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ zend_module_entry mhash_module_entry = {
NULL,
NULL,
PHP_MINFO(mhash),
NO_VERSION_YET,
PHP_MHASH_VERSION,
STANDARD_MODULE_PROPERTIES,
};

Expand Down Expand Up @@ -1271,19 +1271,15 @@ const zend_function_entry hash_functions[] = {
/* {{{ hash_module_entry
*/
zend_module_entry hash_module_entry = {
#if ZEND_MODULE_API_NO >= 20010901
STANDARD_MODULE_HEADER,
#endif
PHP_HASH_EXTNAME,
hash_functions,
PHP_MINIT(hash),
PHP_MSHUTDOWN(hash),
NULL, /* RINIT */
NULL, /* RSHUTDOWN */
PHP_MINFO(hash),
#if ZEND_MODULE_API_NO >= 20010901
PHP_HASH_EXTVER, /* Replace with version number for your extension */
#endif
PHP_HASH_VERSION,
STANDARD_MODULE_PROPERTIES
};
/* }}} */
Expand Down
3 changes: 2 additions & 1 deletion ext/hash/php_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#include "php.h"

#define PHP_HASH_EXTNAME "hash"
#define PHP_HASH_EXTVER "1.0"
#define PHP_HASH_VERSION "1.0"
#define PHP_MHASH_VERSION "1.0"
#define PHP_HASH_RESNAME "Hash Context"

#define PHP_HASH_HMAC 0x0001
Expand Down
2 changes: 1 addition & 1 deletion ext/iconv/iconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ zend_module_entry iconv_module_entry = {
NULL,
NULL,
PHP_MINFO(miconv),
NO_VERSION_YET,
PHP_ICONV_VERSION,
PHP_MODULE_GLOBALS(iconv),
PHP_GINIT(iconv),
NULL,
Expand Down
3 changes: 3 additions & 0 deletions ext/iconv/php_iconv.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
# define PHP_ICONV_API
#endif

#include "php_version.h"
#define PHP_ICONV_VERSION PHP_VERSION

#ifdef PHP_ATOM_INC
#include "ext/iconv/php_have_iconv.h"
#include "ext/iconv/php_have_libiconv.h"
Expand Down
2 changes: 1 addition & 1 deletion ext/imap/php_imap.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ zend_module_entry imap_module_entry = {
PHP_RINIT(imap),
PHP_RSHUTDOWN(imap),
PHP_MINFO(imap),
NO_VERSION_YET,
PHP_IMAP_VERSION,
PHP_MODULE_GLOBALS(imap),
PHP_GINIT(imap),
NULL,
Expand Down
2 changes: 2 additions & 0 deletions ext/imap/php_imap.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
extern zend_module_entry imap_module_entry;
#define imap_module_ptr &imap_module_entry

#include "php_version.h"
#define PHP_IMAP_VERSION PHP_VERSION

/* Data types */

Expand Down
2 changes: 1 addition & 1 deletion ext/interbase/interbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ zend_module_entry ibase_module_entry = {
NULL,
PHP_RSHUTDOWN(ibase),
PHP_MINFO(ibase),
NO_VERSION_YET,
PHP_INTERBASE_VERSION,
PHP_MODULE_GLOBALS(ibase),
PHP_GINIT(ibase),
NULL,
Expand Down
3 changes: 3 additions & 0 deletions ext/interbase/php_interbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
extern zend_module_entry ibase_module_entry;
#define phpext_interbase_ptr &ibase_module_entry

#include "php_version.h"
#define PHP_INTERBASE_VERSION PHP_VERSION

PHP_MINIT_FUNCTION(ibase);
PHP_RINIT_FUNCTION(ibase);
PHP_MSHUTDOWN_FUNCTION(ibase);
Expand Down
2 changes: 0 additions & 2 deletions ext/intl/php_intl.c
Original file line number Diff line number Diff line change
Expand Up @@ -874,9 +874,7 @@ static PHP_GINIT_FUNCTION(intl);

/* {{{ intl_module_entry */
zend_module_entry intl_module_entry = {
#if ZEND_MODULE_API_NO >= 20010901
STANDARD_MODULE_HEADER,
#endif
"intl",
intl_functions,
PHP_MINIT( intl ),
Expand Down
2 changes: 1 addition & 1 deletion ext/ldap/ldap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3289,7 +3289,7 @@ zend_module_entry ldap_module_entry = { /* {{{ */
NULL,
NULL,
PHP_MINFO(ldap),
NO_VERSION_YET,
PHP_LDAP_VERSION,
PHP_MODULE_GLOBALS(ldap),
PHP_GINIT(ldap),
NULL,
Expand Down
3 changes: 3 additions & 0 deletions ext/ldap/php_ldap.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
extern zend_module_entry ldap_module_entry;
#define ldap_module_ptr &ldap_module_entry

#include "php_version.h"
#define PHP_LDAP_VERSION PHP_VERSION

/* LDAP functions */
PHP_MINIT_FUNCTION(ldap);
PHP_MSHUTDOWN_FUNCTION(ldap);
Expand Down
2 changes: 1 addition & 1 deletion ext/libxml/libxml.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ zend_module_entry libxml_module_entry = {
PHP_RINIT(libxml), /* per-request startup function */
PHP_RSHUTDOWN(libxml), /* per-request shutdown function */
PHP_MINFO(libxml), /* information function */
NO_VERSION_YET,
PHP_LIBXML_VERSION,
PHP_MODULE_GLOBALS(libxml), /* globals descriptor */
PHP_GINIT(libxml), /* globals ctor */
NULL, /* globals dtor */
Expand Down
3 changes: 3 additions & 0 deletions ext/libxml/php_libxml.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
extern zend_module_entry libxml_module_entry;
#define libxml_module_ptr &libxml_module_entry

#include "php_version.h"
#define PHP_LIBXML_VERSION PHP_VERSION

#ifdef PHP_WIN32
# define PHP_LIBXML_API __declspec(dllexport)
#elif defined(__GNUC__) && __GNUC__ >= 4
Expand Down
2 changes: 1 addition & 1 deletion ext/mbstring/mbstring.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ zend_module_entry mbstring_module_entry = {
PHP_RINIT(mbstring),
PHP_RSHUTDOWN(mbstring),
PHP_MINFO(mbstring),
NO_VERSION_YET,
PHP_MBSTRING_VERSION,
PHP_MODULE_GLOBALS(mbstring),
PHP_GINIT(mbstring),
PHP_GSHUTDOWN(mbstring),
Expand Down
3 changes: 3 additions & 0 deletions ext/mbstring/mbstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
#define HAVE_MBSTRING 1
#endif

#include "php_version.h"
#define PHP_MBSTRING_VERSION PHP_VERSION

#ifdef PHP_WIN32
# undef MBSTRING_API
# ifdef MBSTRING_EXPORTS
Expand Down
2 changes: 1 addition & 1 deletion ext/mcrypt/mcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ zend_module_entry mcrypt_module_entry = {
PHP_MINIT(mcrypt), PHP_MSHUTDOWN(mcrypt),
NULL, NULL,
PHP_MINFO(mcrypt),
NO_VERSION_YET,
PHP_MCRYPT_VERSION,
PHP_MODULE_GLOBALS(mcrypt),
NULL,
NULL,
Expand Down
3 changes: 3 additions & 0 deletions ext/mcrypt/php_mcrypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
extern zend_module_entry mcrypt_module_entry;
#define mcrypt_module_ptr &mcrypt_module_entry

#include "php_version.h"
#define PHP_MCRYPT_VERSION PHP_VERSION

/* Functions for both old and new API */
PHP_FUNCTION(mcrypt_ecb);
PHP_FUNCTION(mcrypt_cbc);
Expand Down
6 changes: 1 addition & 5 deletions ext/mysqli/mysqli.c
Original file line number Diff line number Diff line change
Expand Up @@ -1008,20 +1008,16 @@ static const zend_module_dep mysqli_deps[] = {
/* {{{ mysqli_module_entry
*/
zend_module_entry mysqli_module_entry = {
#if ZEND_MODULE_API_NO >= 20050922
STANDARD_MODULE_HEADER_EX, NULL,
mysqli_deps,
#elif ZEND_MODULE_API_NO >= 20010901
STANDARD_MODULE_HEADER,
#endif
"mysqli",
mysqli_functions,
PHP_MINIT(mysqli),
PHP_MSHUTDOWN(mysqli),
PHP_RINIT(mysqli),
PHP_RSHUTDOWN(mysqli),
PHP_MINFO(mysqli),
"0.1", /* Replace with version number for your extension */
PHP_MYSQLI_VERSION,
PHP_MODULE_GLOBALS(mysqli),
PHP_GINIT(mysqli),
NULL,
Expand Down
3 changes: 3 additions & 0 deletions ext/mysqli/php_mysqli.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#define phpext_mysqli_ptr &mysqli_module_entry
extern zend_module_entry mysqli_module_entry;

#include "php_version.h"
#define PHP_MYSQLI_VERSION PHP_VERSION

#endif /* PHP_MYSQLI.H */

/*
Expand Down
2 changes: 1 addition & 1 deletion ext/mysqlnd/mysqlnd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2053,7 +2053,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, info)(const MYSQLND_CONN_DATA * const conn)
/* {{{ mysqlnd_get_client_info */
PHPAPI const char * mysqlnd_get_client_info()
{
return MYSQLND_VERSION;
return PHP_MYSQLND_VERSION;
}
/* }}} */

Expand Down
2 changes: 1 addition & 1 deletion ext/mysqlnd/mysqlnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#ifndef MYSQLND_H
#define MYSQLND_H

#define MYSQLND_VERSION "mysqlnd 5.0.11-dev - 20120503 - $Id$"
#define PHP_MYSQLND_VERSION "mysqlnd 5.0.11-dev - 20120503 - $Id$"
#define MYSQLND_VERSION_ID 50011

#define MYSQLND_PLUGIN_API_VERSION 2
Expand Down
6 changes: 3 additions & 3 deletions ext/mysqlnd/mysqlnd_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ static struct st_mysqlnd_authentication_plugin mysqlnd_native_auth_plugin =
MYSQLND_PLUGIN_API_VERSION,
"auth_plugin_mysql_native_password",
MYSQLND_VERSION_ID,
MYSQLND_VERSION,
PHP_MYSQLND_VERSION,
"PHP License 3.01",
"Andrey Hristov <[email protected]>, Ulf Wendel <[email protected]>, Georg Richter <[email protected]>",
{
Expand Down Expand Up @@ -443,7 +443,7 @@ static struct st_mysqlnd_authentication_plugin mysqlnd_pam_authentication_plugin
MYSQLND_PLUGIN_API_VERSION,
"auth_plugin_mysql_clear_password",
MYSQLND_VERSION_ID,
MYSQLND_VERSION,
PHP_MYSQLND_VERSION,
"PHP License 3.01",
"Andrey Hristov <[email protected]>, Ulf Wendel <[email protected]>, Georg Richter <[email protected]>",
{
Expand Down Expand Up @@ -627,7 +627,7 @@ static struct st_mysqlnd_authentication_plugin mysqlnd_sha256_authentication_plu
MYSQLND_PLUGIN_API_VERSION,
"auth_plugin_sha256_password",
MYSQLND_VERSION_ID,
MYSQLND_VERSION,
PHP_MYSQLND_VERSION,
"PHP License 3.01",
"Andrey Hristov <[email protected]>, Ulf Wendel <[email protected]>",
{
Expand Down
2 changes: 1 addition & 1 deletion ext/mysqlnd/mysqlnd_charset.c
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ static struct st_mysqlnd_plugin_charsets mysqlnd_plugin_charsets_plugin =
MYSQLND_PLUGIN_API_VERSION,
"charsets",
MYSQLND_VERSION_ID,
MYSQLND_VERSION,
PHP_MYSQLND_VERSION,
"PHP License 3.01",
"Andrey Hristov <[email protected]>, Ulf Wendel <[email protected]>, Georg Richter <[email protected]>",
{
Expand Down
2 changes: 1 addition & 1 deletion ext/mysqlnd/mysqlnd_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ static struct st_mysqlnd_plugin_trace_log mysqlnd_plugin_trace_log_plugin =
MYSQLND_PLUGIN_API_VERSION,
"debug_trace",
MYSQLND_VERSION_ID,
MYSQLND_VERSION,
PHP_MYSQLND_VERSION,
"PHP License 3.01",
"Andrey Hristov <[email protected]>, Ulf Wendel <[email protected]>, Georg Richter <[email protected]>",
{
Expand Down
2 changes: 1 addition & 1 deletion ext/mysqlnd/mysqlnd_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static struct st_mysqlnd_plugin_core mysqlnd_plugin_core =
MYSQLND_PLUGIN_API_VERSION,
"mysqlnd",
MYSQLND_VERSION_ID,
MYSQLND_VERSION,
PHP_MYSQLND_VERSION,
"PHP License 3.01",
"Andrey Hristov <[email protected]>, Ulf Wendel <[email protected]>, Georg Richter <[email protected]>",
{
Expand Down
2 changes: 1 addition & 1 deletion ext/mysqlnd/mysqlnd_libmysql_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#define my_ulonglong uint64_t

#define MYSQL_VERSION_ID MYSQLND_VERSION_ID
#define MYSQL_SERVER_VERSION MYSQLND_VERSION
#define MYSQL_SERVER_VERSION PHP_MYSQLND_VERSION
#define MYSQL_ERRMSG_SIZE MYSQLND_ERRMSG_SIZE
#define SQLSTATE_LENGTH MYSQLND_SQLSTATE_LENGTH

Expand Down
2 changes: 1 addition & 1 deletion ext/mysqlnd/php_mysqlnd.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ zend_module_entry mysqlnd_module_entry = {
NULL,
#endif
PHP_MINFO(mysqlnd),
MYSQLND_VERSION,
PHP_MYSQLND_VERSION,
PHP_MODULE_GLOBALS(mysqlnd),
PHP_GINIT(mysqlnd),
NULL,
Expand Down

0 comments on commit 2d78023

Please sign in to comment.