Changeset 1170 for trunk/gsdl/lib
- Timestamp:
- 2000-05-12T15:09:27+12:00 (24 years ago)
- Location:
- trunk/gsdl/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/lib/display.cpp
r1076 r1170 28 28 /* 29 29 $Log$ 30 Revision 1.20 2000/05/12 03:09:23 sjboddie 31 minor modifications to get web library compiling under VC++ 6.0 32 30 33 Revision 1.19 2000/04/06 19:57:58 cs025 31 34 Correcting a correction - reinstated all lib files due to silly … … 691 694 // unicode text 692 695 // get the next two characters 693 unsignedchar c1 = 0, c2 = 0;696 char c1 = 0, c2 = 0; 694 697 if (!fin.eof()) fin.get(c1); 695 698 if (!fin.eof()) fin.get(c2); … … 709 712 // utf-8 text 710 713 // how many characters we get depends on what we find 711 unsignedchar c1 = 0, c2 = 0, c3 = 0;714 char c1 = 0, c2 = 0, c3 = 0; 712 715 while (!fin.eof()) { 713 716 fin.get(c1); -
trunk/gsdl/lib/fileutil.cpp
r1150 r1170 28 28 /* 29 29 $Log$ 30 Revision 1.16 2000/05/12 03:09:22 sjboddie 31 minor modifications to get web library compiling under VC++ 6.0 32 30 33 Revision 1.15 2000/05/04 08:27:28 sjboddie 31 34 modifications for windows ports of GCC … … 121 124 path2.erase (path2.begin(), here); 122 125 123 // return the concatenation of the two strings 124 return path1 + path2; 126 text_t fullpath = path1 + path2; 127 128 // make sure all the right slashes are used 129 here = fullpath.begin(); 130 end = fullpath.end(); 131 while (here != end) { 132 #ifdef __WIN32__ 133 if (*here == '/') *here = '\\'; 134 #else 135 if (*here == '\\') *here = '/'; 136 #endif 137 here ++; 138 } 139 return fullpath; 125 140 } 126 141 … … 142 157 bool file_exists (const text_t &filename) { 143 158 char *cstr = filename.getcstr(); 159 #ifdef GSDL_USE_IOS_H 144 160 ifstream filestream (cstr, ios::in | ios::nocreate); 161 #else 162 ifstream filestream (cstr, ios::in); 163 #endif 145 164 delete cstr; 146 165 … … 158 177 bool file_writable (const text_t &filename) { 159 178 char *cstr = filename.getcstr(); 179 #ifdef GSDL_USE_IOS_H 160 180 ifstream filestream (cstr, ios::out | ios::nocreate); 181 #else 182 ifstream filestream (cstr, ios::out); 183 #endif 161 184 delete cstr; 162 185 -
trunk/gsdl/lib/gsdlconf.h
r1167 r1170 80 80 #endif 81 81 82 // mktemp 83 84 #if !defined(__WIN32__) || defined(__GNUC__) 85 #include <unistd.h> 86 #define GSDL_MKTEMP(str) mktemp(str) 87 #else 88 #include <io.h> 89 #define GSDL_MKTEMP(str) _mktemp(str) 90 #endif 91 92 82 93 83 94 // file locking 84 95 85 96 #if defined(__WIN32__) 97 98 #if !defined(LK_UNLOCK) && defined(LK_UNLCK) 99 #define LK_UNLOCK LK_UNLCK 100 #endif 101 102 #if defined (GSDL_USE_IOS_H) 86 103 #include <io.h> 87 104 #include <sys/locking.h> 105 88 106 #if defined(__GNUC__) 89 107 #define GSDL_GET_FILEDESC(str) str.filedesc() … … 91 109 #define GSDL_GET_FILEDESC(str) str.fd() 92 110 #endif 93 #if !defined(LK_UNLOCK) && defined(LK_UNLCK) 94 #define LK_UNLOCK LK_UNLCK 111 112 #define GSDL_UNLOCK_FILE(fd) _locking(fd, LK_UNLCK, 200) 113 #define GSDL_LOCK_FILE(fd) lock_val = _locking(fd, LK_NBLCK, 200) 114 115 #else 116 117 // when using <fstream> (i.e. VC++ 6.0) I can't work out how 118 // to return a filedesc. File locking won't currently work 119 // for those windows compilers requiring GSDL_USE_IOS_H to 120 // not be set -- Stefan. 121 #define GSDL_GET_FILEDESC(str) 1 122 #define GSDL_LOCK_FILE(fd) lock_val = 0 123 #define GSDL_UNLOCK_FILE(fd) 0 95 124 #endif 96 #define GSDL_UNLOCK_FILE(fd) _locking(fd, LK_UNLOCK, 200)97 #define GSDL_LOCK_FILE(fd) lock_val = _locking(fd, LK_NBLCK, 200)98 125 99 126 #else
Note:
See TracChangeset
for help on using the changeset viewer.