Don't forward declare static functions in sendmail.h (GH-17684)

sendmail.h is not only included by sendmail.c, but also by
php_win32_globals.h, because that header uses some of the defined
macros.  However, the forward declarations of the static functions are
not needed anywhere else than in sendmail.c, and Clang warns about the
unused functions elsewhere (`-Wunused-function`).  Thus we move the
forward declarations to sendmail.c.
This commit is contained in:
Christoph M. Becker 2025-02-03 16:50:32 +01:00 committed by GitHub
parent 3fa9e283a0
commit 4e6a3cecf5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 9 deletions

View file

@ -111,6 +111,15 @@ static char *ErrorMessages[] =
#define PHP_WIN32_MAIL_DOT_PATTERN "\n."
#define PHP_WIN32_MAIL_DOT_REPLACE "\n.."
static int SendText(char *RPath, const char *Subject, const char *mailTo, char *mailCc, char *mailBcc, const char *data,
const char *headers, char *headers_lc, char **error_message);
static int MailConnect();
static int PostHeader(char *RPath, const char *Subject, const char *mailTo, char *xheaders);
static int Post(LPCSTR msg);
static int Ack(char **server_response);
static unsigned long GetAddr(LPSTR szHost);
static int FormatEmailAddress(char* Buf, char* EmailAddress, char* FormatString);
/* This function is meant to unify the headers passed to to mail()
* This means, use PCRE to transform single occurrences of \n or \r in \r\n
* As a second step we also eliminate all \r\n occurrences which are:

View file

@ -36,14 +36,5 @@ PHPAPI int TSendMail(const char *host, int *error, char **error_message,
const char *headers, const char *Subject, const char *mailTo, const char *data,
char *mailCc, char *mailBcc, char *mailRPath);
PHPAPI void TSMClose(void);
static int SendText(char *RPath, const char *Subject, const char *mailTo, char *mailCc, char *mailBcc, const char *data,
const char *headers, char *headers_lc, char **error_message);
PHPAPI char *GetSMErrorText(int index);
static int MailConnect();
static int PostHeader(char *RPath, const char *Subject, const char *mailTo, char *xheaders);
static int Post(LPCSTR msg);
static int Ack(char **server_response);
static unsigned long GetAddr(LPSTR szHost);
static int FormatEmailAddress(char* Buf, char* EmailAddress, char* FormatString);
#endif /* sendmail_h */