From 50b3a0d011127b69e8432c37f98c87725981962f Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 8 Sep 2024 16:11:25 +0200 Subject: [PATCH] Add comments about internal headers (GH-15689) A common convention is to name internal C header files as `*_int.h`. Since a couple of these are actually installed, we add comments that this is not supposed to happen, (a) to avoid installing further internal headers, and (b) to pave the way to fix this in the next major PHP version. Somewhat special is php_gmp_int.h, where "int" is meant as abbreviation for "interface". Another common convention is appending `_priv` or `_private`, but since there have not been any issues regarding these headers so far, we refrain from adding respective comments to these headers. Anyhow, it might be a good idea to introduce some common naming convention for such internal/private headers. --- Zend/zend_strtod_int.h | 2 ++ ext/gmp/php_gmp_int.h | 2 ++ ext/pdo_dblib/php_pdo_dblib_int.h | 2 ++ ext/pdo_firebird/php_pdo_firebird_int.h | 2 ++ ext/pdo_mysql/php_pdo_mysql_int.h | 2 ++ ext/pdo_odbc/php_pdo_odbc_int.h | 2 ++ ext/pdo_pgsql/php_pdo_pgsql_int.h | 2 ++ ext/standard/php_dir_int.h | 2 ++ main/streams/php_streams_int.h | 2 ++ 9 files changed, 18 insertions(+) diff --git a/Zend/zend_strtod_int.h b/Zend/zend_strtod_int.h index 79b993f7dbd..06a02618e9e 100644 --- a/Zend/zend_strtod_int.h +++ b/Zend/zend_strtod_int.h @@ -16,6 +16,8 @@ +----------------------------------------------------------------------+ */ +/* internal header; not supposed to be installed; FIXME but unfortunately is */ + #ifndef ZEND_STRTOD_INT_H #define ZEND_STRTOD_INT_H diff --git a/ext/gmp/php_gmp_int.h b/ext/gmp/php_gmp_int.h index d67fdd5c622..32f1d32f592 100644 --- a/ext/gmp/php_gmp_int.h +++ b/ext/gmp/php_gmp_int.h @@ -1,3 +1,5 @@ +/* interface header; needs to be installed; FIXME rename? */ + #ifndef incl_PHP_GMP_INT_H #define incl_PHP_GMP_INT_H diff --git a/ext/pdo_dblib/php_pdo_dblib_int.h b/ext/pdo_dblib/php_pdo_dblib_int.h index 8f8d0e3c827..2067d944c71 100644 --- a/ext/pdo_dblib/php_pdo_dblib_int.h +++ b/ext/pdo_dblib/php_pdo_dblib_int.h @@ -15,6 +15,8 @@ +----------------------------------------------------------------------+ */ +/* internal header; not supposed to be installed */ + #ifndef PHP_PDO_DBLIB_INT_H #define PHP_PDO_DBLIB_INT_H diff --git a/ext/pdo_firebird/php_pdo_firebird_int.h b/ext/pdo_firebird/php_pdo_firebird_int.h index dc1e4bb7f40..2b8d00a4e37 100644 --- a/ext/pdo_firebird/php_pdo_firebird_int.h +++ b/ext/pdo_firebird/php_pdo_firebird_int.h @@ -14,6 +14,8 @@ +----------------------------------------------------------------------+ */ +/* internal header; not supposed to be installed */ + #ifndef PHP_PDO_FIREBIRD_INT_H #define PHP_PDO_FIREBIRD_INT_H diff --git a/ext/pdo_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h index b2e15e3080d..9c78813d5f2 100644 --- a/ext/pdo_mysql/php_pdo_mysql_int.h +++ b/ext/pdo_mysql/php_pdo_mysql_int.h @@ -16,6 +16,8 @@ +----------------------------------------------------------------------+ */ +/* internal header; not supposed to be installed */ + #ifndef PHP_PDO_MYSQL_INT_H #define PHP_PDO_MYSQL_INT_H diff --git a/ext/pdo_odbc/php_pdo_odbc_int.h b/ext/pdo_odbc/php_pdo_odbc_int.h index e082ae75123..473d70ff707 100644 --- a/ext/pdo_odbc/php_pdo_odbc_int.h +++ b/ext/pdo_odbc/php_pdo_odbc_int.h @@ -14,6 +14,8 @@ +----------------------------------------------------------------------+ */ +/* internal header; not supposed to be installed */ + #ifdef PHP_WIN32 # define PDO_ODBC_TYPE "Win32" #endif diff --git a/ext/pdo_pgsql/php_pdo_pgsql_int.h b/ext/pdo_pgsql/php_pdo_pgsql_int.h index 3cd0b005fcc..fc9f1664cc3 100644 --- a/ext/pdo_pgsql/php_pdo_pgsql_int.h +++ b/ext/pdo_pgsql/php_pdo_pgsql_int.h @@ -16,6 +16,8 @@ +----------------------------------------------------------------------+ */ +/* internal header; not supposed to be installed */ + #ifndef PHP_PDO_PGSQL_INT_H #define PHP_PDO_PGSQL_INT_H diff --git a/ext/standard/php_dir_int.h b/ext/standard/php_dir_int.h index a359cb725d0..f9d63e78661 100644 --- a/ext/standard/php_dir_int.h +++ b/ext/standard/php_dir_int.h @@ -12,6 +12,8 @@ +----------------------------------------------------------------------+ */ +/* internal header; not supposed to be installed; FIXME but unfortunately is */ + #ifndef PHP_DIR_INT_H #define PHP_DIR_INT_H diff --git a/main/streams/php_streams_int.h b/main/streams/php_streams_int.h index a3c55bdd4f0..7580088fba3 100644 --- a/main/streams/php_streams_int.h +++ b/main/streams/php_streams_int.h @@ -14,6 +14,8 @@ +----------------------------------------------------------------------+ */ +/* internal header; not supposed to be installed; FIXME but unfortunately is */ + #if ZEND_DEBUG #define emalloc_rel_orig(size) \