From b9782e8bf3be430ba30ac60d13b3d330234bf9e0 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 1 Sep 2024 13:24:36 +0200 Subject: [PATCH] Add comments about internal headers 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 79b993f7dbd9f..06a02618e9e6a 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 d67fdd5c62236..32f1d32f592ab 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 8f8d0e3c827eb..2067d944c7182 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 dc1e4bb7f4086..2b8d00a4e37e6 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 b2e15e3080d5a..9c78813d5f249 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 e082ae7512355..473d70ff70763 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 3cd0b005fcc55..fc9f1664cc3d4 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 a359cb725d085..f9d63e78661a1 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 a3c55bdd4f066..7580088fba316 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) \