summaryrefslogtreecommitdiff
blob: 79a4ea0888e23ef0dca26a583b15cc2b461c5c07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
diff -urN pwlib-orig/include/ptclib/asner.h pwlib/include/ptclib/asner.h
--- pwlib-orig/include/ptclib/asner.h	Tue May 28 19:22:35 2002
+++ pwlib/include/ptclib/asner.h	Wed Jul  3 13:45:56 2002
@@ -535,8 +535,8 @@
     operator const PBYTEArray &() const { return value; }
     operator const BYTE *() const { return value; }
     PString AsString() const;
-    BYTE operator[](PINDEX i) const { return value[i]; }
-    BYTE & operator[](PINDEX i) { return value[i]; }
+    BYTE operator[](int i) const { return value[(PINDEX) i]; }
+    BYTE & operator[](int i) { return value[(PINDEX) i]; }
     BYTE * GetPointer(PINDEX sz = 0) { return value.GetPointer(sz); }
     PINDEX GetSize() const { return value.GetSize(); }
     BOOL SetSize(PINDEX newSize);
diff -urN pwlib-orig/include/ptlib/array.h pwlib/include/ptlib/array.h
--- pwlib-orig/include/ptlib/array.h	Thu Feb 14 16:37:53 2002
+++ pwlib/include/ptlib/array.h	Wed Jul  3 13:46:03 2002
@@ -406,8 +406,8 @@
        value at the array position.
      */
     T operator[](
-      PINDEX index  /// Position on the array to get value from.
-    ) const { return GetAt(index); }
+      int index  /// Position on the array to get value from.
+    ) const { return GetAt((PINDEX) index); }
 
     /**Get a reference to value from the array. If the #index# is
        beyond the end of the allocated array then the array is expanded. If a
@@ -420,8 +420,9 @@
        reference to value at the array position.
      */
     T & operator[](
-      PINDEX index  /// Position on the array to get value from.
-    ) { PASSERTINDEX(index); PAssert(SetMinSize(index+1), POutOfMemory);
+      int i  /// Position on the array to get value from.
+    ) { PINDEX index =i; 
+       PASSERTINDEX(index); PAssert(SetMinSize(index+1), POutOfMemory);
         return ((T *)theArray)[index]; }
 
     /**Get a pointer to the internal array. The user may not modify the
@@ -508,10 +509,10 @@
     inline P_##cls##_Base_Type GetAt(PINDEX index) const \
       { PASSERTINDEX(index); return index < GetSize() ? \
           ((P_##cls##_Base_Type*)theArray)[index] : (P_##cls##_Base_Type)0; } \
-    inline P_##cls##_Base_Type operator[](PINDEX index) const \
-      { PASSERTINDEX(index); return GetAt(index); } \
-    inline P_##cls##_Base_Type & operator[](PINDEX index) \
-      { PASSERTINDEX(index); PAssert(SetMinSize(index+1), POutOfMemory); \
+    inline P_##cls##_Base_Type operator[](int index) const \
+      { PASSERTINDEX(index); return GetAt((PINDEX) index); } \
+    inline P_##cls##_Base_Type & operator[](int i) \
+      { PINDEX index = i; PASSERTINDEX(index); PAssert(SetMinSize(index+1), POutOfMemory); \
         return ((P_##cls##_Base_Type *)theArray)[index]; } \
     inline void Attach(const P_##cls##_Base_Type * buffer, PINDEX bufferSize) \
       { PAbstractArray::Attach(buffer, bufferSize); } \
diff -urN pwlib-orig/make/unix.mak pwlib/make/unix.mak
--- pwlib-orig/make/unix.mak	Fri May 31 00:37:22 2002
+++ pwlib/make/unix.mak	Wed Jul  3 13:46:11 2002
@@ -565,6 +565,9 @@
 
 ifeq ($(OSTYPE),linux)
 
+# We want to be GCC 3.1 compatible
+STDCCFLAGS      += -DGCC3 -D__USE_STL__
+
 # i486 Linux for x86, using gcc 2.7.2
 STDCCFLAGS	+= -DP_LINUX
 
@@ -1112,7 +1115,16 @@
 PW_LIBDIR	= $(PWLIBDIR)/lib
 
 # set name of the PT library
-PTLIB_BASE	= pt_$(PLATFORM_TYPE)_$(OBJ_SUFFIX)
+ifeq ($(findstring $(OBJ_SUFFIX),d),)
+ifeq ($(LIB_SUFFIX),a)
+PTLIB_BASE      = pt
+else
+PTLIB_BASE      = pt$(LIBPTCOMPAT)
+endif
+LIB_TYPE        =
+else
+PTLIB_BASE      = pt_$(OBJ_SUFFIX)
+endif
 PTLIB_FILE	= lib$(PTLIB_BASE)$(LIB_TYPE).$(LIB_SUFFIX)
 PT_OBJBASE	= obj_$(PLATFORM_TYPE)_$(OBJDIR_SUFFIX)
 PT_OBJDIR	= $(PW_LIBDIR)/$(PT_OBJBASE)
diff -urN pwlib-orig/src/ptlib/common/osutils.cxx pwlib/src/ptlib/common/osutils.cxx
--- pwlib-orig/src/ptlib/common/osutils.cxx	Thu May 30 22:10:44 2002
+++ pwlib/src/ptlib/common/osutils.cxx	Wed Jul  3 13:46:21 2002
@@ -877,12 +877,12 @@
      stderr is used the unitbuf flag causes the out_waiting() not to work so we 
      must suffer with blank lines in that case.
    */
-  if ((s.flags()&ios::unitbuf) != 0 || s.rdbuf()->out_waiting() > 0) {
+  //if ((s.flags()&ios::unitbuf) != 0 || s.rdbuf()->out_waiting() > 0) {
     if ((PTraceOptions&SystemLogStream) != 0)
       s.flush();
     else
       s << endl;
-  }
+ // }
 
   PTraceMutex->Signal();
 
diff -urN pwlib-orig/src/ptlib/common/sockets.cxx pwlib/src/ptlib/common/sockets.cxx
--- pwlib-orig/src/ptlib/common/sockets.cxx	Wed May 22 01:18:46 2002
+++ pwlib/src/ptlib/common/sockets.cxx	Wed Jul  3 13:46:28 2002
@@ -805,6 +805,8 @@
 
 PSocket::PSocket()
 {
+  SetReadTimeout(10000);
+  SetWriteTimeout(10000);
   port = 0;
 }
 
diff -urN pwlib-orig/src/ptlib/unix/channel.cxx pwlib/src/ptlib/unix/channel.cxx
--- pwlib-orig/src/ptlib/unix/channel.cxx	Sat Jan 26 16:58:15 2002
+++ pwlib/src/ptlib/unix/channel.cxx	Wed Jul  3 13:46:37 2002
@@ -354,7 +354,7 @@
   return stat;
 }
 
-PString PChannel::GetErrorText(Errors normalisedError, int osError = 0)
+PString PChannel::GetErrorText(Errors normalisedError, int osError)
 {
   if (osError == 0) {
     if (normalisedError == NoError)