File pointer_to_literals.patch of Package postfix
diff -urN postfix-2.5.6-dynamic_maps_pie.patch/src/cleanup/cleanup_message.c postfix-2.5.6-pointer_to_literals.patch/src/cleanup/cleanup_message.c
--- postfix-2.5.6-dynamic_maps_pie.patch/src/cleanup/cleanup_message.c 2008-01-09 14:59:40.000000000 +0100
+++ postfix-2.5.6-pointer_to_literals.patch/src/cleanup/cleanup_message.c 2011-03-17 08:14:29.653969000 +0100
@@ -290,7 +290,7 @@
while (*optional_text && ISSPACE(*optional_text))
optional_text++;
-#define STREQUAL(x,y,l) (strncasecmp((x), (y), (l)) == 0 && (y)[l] == 0)
+inline int STREQUAL(const char *x, const char *y, size_t l) { return (strncasecmp((x), (y), (l)) == 0 && (y)[l] == 0); }
#define CLEANUP_ACT_DROP 0
/*
diff -urN postfix-2.5.6-dynamic_maps_pie.patch/src/local/local_expand.c postfix-2.5.6-pointer_to_literals.patch/src/local/local_expand.c
--- postfix-2.5.6-dynamic_maps_pie.patch/src/local/local_expand.c 2005-05-31 15:44:14.000000000 +0200
+++ postfix-2.5.6-pointer_to_literals.patch/src/local/local_expand.c 2011-03-17 08:14:29.654969001 +0100
@@ -114,7 +114,7 @@
{
LOCAL_EXP *local = (LOCAL_EXP *) ptr;
-#define STREQ(x,y) (*(x) == *(y) && strcmp((x), (y)) == 0)
+inline int STREQ(const char *x, const char *y) { return (*(x) == *(y) && strcmp((x), (y)) == 0); }
if (STREQ(name, "user")) {
return (local->state->msg_attr.user);
diff -urN postfix-2.5.6-dynamic_maps_pie.patch/src/smtpd/smtpd_check.c postfix-2.5.6-pointer_to_literals.patch/src/smtpd/smtpd_check.c
--- postfix-2.5.6-dynamic_maps_pie.patch/src/smtpd/smtpd_check.c 2008-04-11 21:46:54.000000000 +0200
+++ postfix-2.5.6-pointer_to_literals.patch/src/smtpd/smtpd_check.c 2011-03-17 08:14:29.668969002 +0100
@@ -353,6 +353,10 @@
#define CONST_STR(x) ((const char *) vstring_str(x))
#define UPDATE_STRING(ptr,val) { if (ptr) myfree(ptr); ptr = mystrdup(val); }
+inline int STREQ(const char *x, const char *y) { return (*(x) == *(y) && strcmp((x), (y)) == 0); }
+inline int STREQUAL(const char *x, const char *y, size_t l) { return (strncasecmp((x), (y), (l)) == 0 && (y)[l] == 0); }
+inline int STREQN(const char *x, const char *y, size_t n) { return (*(x) == *(y) && strncmp((x), (y), (n)) == 0); }
+
/*
* If some decision can't be made due to a temporary error, then change
* other decisions into deferrals.
@@ -1944,8 +1948,6 @@
if (msg_verbose)
msg_info("%s: %s %s %s", myname, table, value, datum);
-#define STREQUAL(x,y,l) (strncasecmp((x), (y), (l)) == 0 && (y)[l] == 0)
-
/*
* DUNNO means skip this table. Silently ignore optional text.
*/
@@ -2810,7 +2812,6 @@
/*
* "sender_name" or "recipient_name".
*/
-#define STREQ(x,y) (*(x) == *(y) && strcmp((x), (y)) == 0)
else if (STREQ(suffix, MAIL_ATTR_S_NAME)) {
if (*addr) {
@@ -2860,7 +2861,6 @@
if (msg_verbose > 1)
msg_info("smtpd_expand_lookup: ${%s}", name);
-#define STREQN(x,y,n) (*(x) == *(y) && strncmp((x), (y), (n)) == 0)
#define CONST_LEN(x) (sizeof(x) - 1)
/*
diff -urN postfix-2.5.6-dynamic_maps_pie.patch/src/util/dict_open.c postfix-2.5.6-pointer_to_literals.patch/src/util/dict_open.c
--- postfix-2.5.6-dynamic_maps_pie.patch/src/util/dict_open.c 2011-03-15 12:27:38.491920001 +0100
+++ postfix-2.5.6-pointer_to_literals.patch/src/util/dict_open.c 2011-03-17 08:14:29.698969001 +0100
@@ -457,7 +457,7 @@
}
#ifndef NO_DYNAMIC_MAPS
-#define STREQ(x,y) (x == y || (x[0] == y[0] && strcmp(x,y) == 0))
+inline int STREQ(const char *x, const char *y) { return ( x == y || (*(x) == *(y) && strcmp((x), (y)) == 0)); }
void dict_open_dlinfo(const char *path)
{