Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 219092 | Differences between
and this patch

Collapse All | Expand All

(-)postal-0.69.orig/bhm.cpp (+1 lines)
Lines 7-16 Link Here
7
#include <ctype.h>
7
#include <ctype.h>
8
#include <unistd.h>
8
#include <unistd.h>
9
#include <sys/wait.h>
9
#include <sys/wait.h>
10
#include <signal.h>
10
#include <signal.h>
11
#include <stdio.h>
11
#include <stdio.h>
12
#include <cstdlib>
12
#include <sys/poll.h>
13
#include <sys/poll.h>
13
#include <sys/types.h>
14
#include <sys/types.h>
14
#include <sys/socket.h>
15
#include <sys/socket.h>
15
#include <arpa/inet.h>
16
#include <arpa/inet.h>
16
#include <netinet/ip.h>
17
#include <netinet/ip.h>
(-)postal-0.69.orig/bhmusers.cpp (+1 lines)
Lines 1-9 Link Here
1
#include "bhmusers.h"
1
#include "bhmusers.h"
2
#include <stdio.h>
2
#include <stdio.h>
3
#include <cstring>
3
#include <cstring>
4
#include "expand.h"
4
#include "expand.h"
5
#include <cstdlib>
5
6
6
BHMUsers::BHMUsers(const char *userListFile)
7
BHMUsers::BHMUsers(const char *userListFile)
7
{
8
{
8
  char buf[1024];
9
  char buf[1024];
9
  FILE *fp = fopen(userListFile, "r");
10
  FILE *fp = fopen(userListFile, "r");
(-)postal-0.69.orig/bhmusers.h (+9 lines)
Lines 4-19 Link Here
4
using namespace std;
4
using namespace std;
5
5
6
#include <string>
6
#include <string>
7
#include "conf.h"
7
#include "conf.h"
8
8
9
#ifdef HAVE_STDCXX_0X
10
#include <unordered_map>
11
#include <tr1/functional_hash.h>
12
#else
9
#ifdef HAVE_EXT_HASH_MAP
13
#ifdef HAVE_EXT_HASH_MAP
10
using namespace __gnu_cxx;
14
using namespace __gnu_cxx;
11
#include <ext/hash_map>
15
#include <ext/hash_map>
12
#else
16
#else
13
#include <hash_map.h>
17
#include <hash_map.h>
14
#endif
18
#endif
19
#endif
15
20
16
#include "postal.h"
21
#include "postal.h"
17
22
18
typedef enum { eNone = 0, eDefer, eReject, eBounce, eGrey } USER_SMTP_ACTION;
23
typedef enum { eNone = 0, eDefer, eReject, eBounce, eGrey } USER_SMTP_ACTION;
19
24
Lines 21-30 Link Here
21
{
26
{
22
  USER_SMTP_ACTION action;
27
  USER_SMTP_ACTION action;
23
  int sync_time;
28
  int sync_time;
24
} BHM_DATA;
29
} BHM_DATA;
25
30
31
#ifdef HAVE_STDCXX_0X
32
typedef unordered_map<string, BHM_DATA , hash<string> > NAME_MAP;
33
#else
26
namespace __gnu_cxx
34
namespace __gnu_cxx
27
{
35
{
28
  template<> struct hash< std::string >
36
  template<> struct hash< std::string >
29
  {
37
  {
30
    size_t operator() ( const std::string &x ) const
38
    size_t operator() ( const std::string &x ) const
Lines 33-42 Link Here
33
    }
41
    }
34
  };
42
  };
35
}
43
}
36
44
37
typedef hash_map<string, BHM_DATA , hash<string> > NAME_MAP;
45
typedef hash_map<string, BHM_DATA , hash<string> > NAME_MAP;
46
#endif
38
47
39
class BHMUsers
48
class BHMUsers
40
{
49
{
41
public:
50
public:
42
  BHMUsers(const char *userListFile);
51
  BHMUsers(const char *userListFile);
(-)postal-0.69.orig/configure.in (+92 lines)
Lines 155-160 Link Here
155
155
156
AC_CHECK_HEADERS(vector ext/hash_map)
156
AC_CHECK_HEADERS(vector ext/hash_map)
157
157
158
dnl Checks for library functions.
158
dnl Checks for library functions.
159
159
160
AC_DEFUN([AC_COMPILE_STDCXX_0X], [
161
  AC_CACHE_CHECK(if g++ supports C++0x features without additional flags,
162
  ac_cv_cxx_compile_cxx0x_native,
163
  [AC_LANG_SAVE
164
  AC_LANG_CPLUSPLUS
165
  AC_TRY_COMPILE([
166
  template <typename T>
167
    struct check 
168
    {
169
      static_assert(sizeof(int) <= sizeof(T), "not big enough");
170
    };
171
172
    typedef check<check<bool>> right_angle_brackets;
173
174
    int a;
175
    decltype(a) b;
176
177
    typedef check<int> check_type;
178
    check_type c;
179
    check_type&& cr = c;],,
180
  ac_cv_cxx_compile_cxx0x_native=yes, ac_cv_cxx_compile_cxx0x_native=no)
181
  AC_LANG_RESTORE
182
  ])
183
184
  AC_CACHE_CHECK(if g++ supports C++0x features with -std=c++0x,
185
  ac_cv_cxx_compile_cxx0x_cxx,
186
  [AC_LANG_SAVE
187
  AC_LANG_CPLUSPLUS
188
  ac_save_CXXFLAGS="$CXXFLAGS"
189
  CXXFLAGS="$CXXFLAGS -std=c++0x"       
190
  AC_TRY_COMPILE([
191
  template <typename T>
192
    struct check 
193
    {
194
      static_assert(sizeof(int) <= sizeof(T), "not big enough");
195
    };
196
197
    typedef check<check<bool>> right_angle_brackets;
198
199
    int a;
200
    decltype(a) b;
201
202
    typedef check<int> check_type;
203
    check_type c;
204
    check_type&& cr = c;],,
205
  ac_cv_cxx_compile_cxx0x_cxx=yes, ac_cv_cxx_compile_cxx0x_cxx=no)
206
  CXXFLAGS="$ac_save_CXXFLAGS"
207
  AC_LANG_RESTORE
208
  ])
209
210
  AC_CACHE_CHECK(if g++ supports C++0x features with -std=gnu++0x,
211
  ac_cv_cxx_compile_cxx0x_gxx,
212
  [AC_LANG_SAVE
213
  AC_LANG_CPLUSPLUS
214
  ac_save_CXXFLAGS="$CXXFLAGS"
215
  CXXFLAGS="$CXXFLAGS -std=gnu++0x"     
216
  AC_TRY_COMPILE([
217
  template <typename T>
218
    struct check 
219
    {
220
      static_assert(sizeof(int) <= sizeof(T), "not big enough");
221
    };
222
223
    typedef check<check<bool>> right_angle_brackets;
224
225
    int a;
226
    decltype(a) b;
227
228
    typedef check<int> check_type;
229
    check_type c;
230
    check_type&& cr = c;],,
231
  ac_cv_cxx_compile_cxx0x_gxx=yes, ac_cv_cxx_compile_cxx0x_gxx=no)
232
  CXXFLAGS="$ac_save_CXXFLAGS"
233
  AC_LANG_RESTORE
234
  ])
235
236
  if test "$ac_cv_cxx_compile_cxx0x_native" = yes || 
237
     test "$ac_cv_cxx_compile_cxx0x_cxx" = yes || 
238
     test "$ac_cv_cxx_compile_cxx0x_gxx" = yes; then
239
    AC_DEFINE(HAVE_STDCXX_0X,,[Define if g++ supports C++0x features. ])
240
  fi
241
])
242
243
AC_COMPILE_STDCXX_0X
244
245
AC_SUBST(cstd)
246
cstd=
247
if test "$ac_cv_cxx_compile_cxx0x_cxx" = yes; then
248
	cstd=-std=c++0x
249
fi
250
160
AC_OUTPUT(Makefile postal.h port.h postal.spec sun/pkginfo)
251
AC_OUTPUT(Makefile postal.h port.h postal.spec sun/pkginfo)
252
(-)postal-0.69.orig/Makefile.in (-2 / +2 lines)
Lines 8-19 Link Here
8
prefix=@prefix@
8
prefix=@prefix@
9
eprefix=@exec_prefix@
9
eprefix=@exec_prefix@
10
WFLAGS=-Wall -W -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wcast-qual -pedantic
10
WFLAGS=-Wall -W -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wcast-qual -pedantic
11
WPLUS=-Woverloaded-virtual -ffor-scope
11
WPLUS=-Woverloaded-virtual -ffor-scope
12
12
13
CXX=@CXX@ $(CFLAGS) -O2 -g $(WFLAGS) $(WPLUS)
13
CXX=@CXX@ @cstd@ $(CFLAGS) $(WFLAGS) $(WPLUS)
14
CC=@CC@ $(CFLAGS) -O2 -g $(WFLAGS)
14
CC=@CC@ $(CFLAGS) $(WFLAGS)
15
15
16
INSTALL=@INSTALL@
16
INSTALL=@INSTALL@
17
17
18
TESTEXE=ex-test
18
TESTEXE=ex-test
19
BASEOBJS=userlist.o thread.o results.o address.o tcp.o cmd5.o mutex.o logit.o expand.o @extra_objs@
19
BASEOBJS=userlist.o thread.o results.o address.o tcp.o cmd5.o mutex.o logit.o expand.o @extra_objs@
(-)postal-0.69.orig/postal.cpp (+1 lines)
Lines 6-15 Link Here
6
#include "smtp.h"
6
#include "smtp.h"
7
#include <unistd.h>
7
#include <unistd.h>
8
#include <sys/wait.h>
8
#include <sys/wait.h>
9
#include <signal.h>
9
#include <signal.h>
10
#include <stdio.h>
10
#include <stdio.h>
11
#include <cstdlib>
11
#include "postal.h"
12
#include "postal.h"
12
#include "logit.h"
13
#include "logit.h"
13
#ifdef USE_GNUTLS
14
#ifdef USE_GNUTLS
14
#include <errno.h>
15
#include <errno.h>
15
#include <gcrypt.h>
16
#include <gcrypt.h>
(-)postal-0.69.orig/smtp.cpp (+1 lines)
Lines 7-16 Link Here
7
#include <time.h>
7
#include <time.h>
8
#include "userlist.h"
8
#include "userlist.h"
9
#include "logit.h"
9
#include "logit.h"
10
#include "results.h"
10
#include "results.h"
11
#include <cstring>
11
#include <cstring>
12
#include <cstdlib>
12
13
13
smtpData::smtpData()
14
smtpData::smtpData()
14
 : m_quit("QUIT\r\n")
15
 : m_quit("QUIT\r\n")
15
 , m_randomLetters("abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 `~!@#$%^&*()-_=+[]{};:'\"|/?<>,")
16
 , m_randomLetters("abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 `~!@#$%^&*()-_=+[]{};:'\"|/?<>,")
16
 , m_randomLen(strlen(m_randomLetters))
17
 , m_randomLen(strlen(m_randomLetters))
(-)postal-0.69.orig/smtp.h (+8 lines)
Lines 4-19 Link Here
4
using namespace std;
4
using namespace std;
5
#include <string>
5
#include <string>
6
#include <cstring>
6
#include <cstring>
7
#include <time.h>
7
#include <time.h>
8
#include "conf.h"
8
#include "conf.h"
9
#ifdef HAVE_STDCXX_0X
10
#include <unordered_map>
11
#else
9
#ifdef HAVE_EXT_HASH_MAP
12
#ifdef HAVE_EXT_HASH_MAP
10
using namespace __gnu_cxx;
13
using namespace __gnu_cxx;
11
#include <ext/hash_map>
14
#include <ext/hash_map>
12
#else
15
#else
13
#include <hash_map.h>
16
#include <hash_map.h>
14
#endif
17
#endif
18
#endif
15
#include "tcp.h"
19
#include "tcp.h"
16
#include "mutex.h"
20
#include "mutex.h"
17
21
18
class results;
22
class results;
19
23
Lines 28-38 Link Here
28
  {
32
  {
29
    return (l1 == l2);
33
    return (l1 == l2);
30
  }
34
  }
31
};
35
};
32
36
37
#ifdef HAVE_STDCXX_0X
38
typedef unordered_map<unsigned long, string *, hash<unsigned long>, eqlng> NAME_MAP;
39
#else
33
typedef hash_map<unsigned long, string *, hash<unsigned long>, eqlng> NAME_MAP;
40
typedef hash_map<unsigned long, string *, hash<unsigned long>, eqlng> NAME_MAP;
41
#endif
34
42
35
class smtpData
43
class smtpData
36
{
44
{
37
public:
45
public:
38
  smtpData();
46
  smtpData();

Return to bug 219092