Skip to content

Commit 4e6a3ce

Browse files
authored
Don't forward declare static functions in sendmail.h (phpGH-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.
1 parent 3fa9e28 commit 4e6a3ce

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

win32/sendmail.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@ static char *ErrorMessages[] =
111111
#define PHP_WIN32_MAIL_DOT_PATTERN "\n."
112112
#define PHP_WIN32_MAIL_DOT_REPLACE "\n.."
113113

114+
static int SendText(char *RPath, const char *Subject, const char *mailTo, char *mailCc, char *mailBcc, const char *data,
115+
const char *headers, char *headers_lc, char **error_message);
116+
static int MailConnect();
117+
static int PostHeader(char *RPath, const char *Subject, const char *mailTo, char *xheaders);
118+
static int Post(LPCSTR msg);
119+
static int Ack(char **server_response);
120+
static unsigned long GetAddr(LPSTR szHost);
121+
static int FormatEmailAddress(char* Buf, char* EmailAddress, char* FormatString);
122+
114123
/* This function is meant to unify the headers passed to to mail()
115124
* This means, use PCRE to transform single occurrences of \n or \r in \r\n
116125
* As a second step we also eliminate all \r\n occurrences which are:

win32/sendmail.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,5 @@ PHPAPI int TSendMail(const char *host, int *error, char **error_message,
3636
const char *headers, const char *Subject, const char *mailTo, const char *data,
3737
char *mailCc, char *mailBcc, char *mailRPath);
3838
PHPAPI void TSMClose(void);
39-
static int SendText(char *RPath, const char *Subject, const char *mailTo, char *mailCc, char *mailBcc, const char *data,
40-
const char *headers, char *headers_lc, char **error_message);
4139
PHPAPI char *GetSMErrorText(int index);
42-
43-
static int MailConnect();
44-
static int PostHeader(char *RPath, const char *Subject, const char *mailTo, char *xheaders);
45-
static int Post(LPCSTR msg);
46-
static int Ack(char **server_response);
47-
static unsigned long GetAddr(LPSTR szHost);
48-
static int FormatEmailAddress(char* Buf, char* EmailAddress, char* FormatString);
4940
#endif /* sendmail_h */

0 commit comments

Comments
 (0)