- Timestamp:
- 02/11/14 00:01:21 (11 years ago)
- Location:
- cpp/frams/virtfile
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/virtfile/virtfile.cpp
r123 r131 59 59 int fwrite(const void *ptr, size_t size, size_t nmemb, VirtFILE* f) {return f->Vwrite(ptr,size,nmemb);} 60 60 61 //for some systems, we need to #undef feof which is unfortunately defined as a macro... we have to #undef just to be able to define our own function with this name. Same in virtfile.h 62 #if defined __BORLANDC__ || defined _MSC_VER || defined __CYGWIN__ || defined SHP 61 62 //since we want our own feof(VirtFILE*) function and some systems unfortunately define feof as a macro, we need to #undef it. Same as in virtfile.h 63 #if defined _MSC_VER || defined __CYGWIN__ || defined SHP 64 #pragma push_macro("feof") 65 #undef feof 66 #endif 67 #if defined __BORLANDC__ //does not support #pragma push_macro/pop_macro 63 68 #undef feof 64 69 #endif … … 67 72 68 73 //...and then restore the original macro: 74 #if defined _MSC_VER || defined __CYGWIN__ || defined SHP 75 #pragma pop_macro("feof") 76 #endif 69 77 #ifdef __BORLANDC__ 70 78 #define feof(__f) ((__f)->flags & _F_EOF) 71 #endif72 #ifdef _MSC_VER73 #define feof(_stream) ((_stream)->_flag & _IOEOF)74 #endif75 #ifdef __CYGWIN__76 #define feof(p) __sfeof(p)77 #endif78 #ifdef SHP79 restore original macro... if you ever want to compile this code on bada80 79 #endif 81 80 -
cpp/frams/virtfile/virtfile.h
r123 r131 72 72 73 73 74 //for some systems, we need to #undef feof which is unfortunately defined as a macro... we have to #undef just to be able to define our own function with this name. Same in virtfile.cpp 75 #if defined __BORLANDC__ || defined _MSC_VER || defined __CYGWIN__ || defined SHP 74 //since we want our own feof(VirtFILE*) function and some systems unfortunately define feof as a macro, we need to #undef it. Same as in virtfile.cpp 75 #if defined _MSC_VER || defined __CYGWIN__ || defined SHP 76 #pragma push_macro("feof") 77 #undef feof 78 #endif 79 #if defined __BORLANDC__ //does not support #pragma push_macro/pop_macro 76 80 #undef feof 77 81 #endif … … 80 84 81 85 //...and then restore the original macro: 86 #if defined _MSC_VER || defined __CYGWIN__ || defined SHP 87 #pragma pop_macro("feof") 88 #endif 82 89 #ifdef __BORLANDC__ 83 90 #define feof(__f) ((__f)->flags & _F_EOF) 84 #endif85 #ifdef _MSC_VER86 #define feof(_stream) ((_stream)->_flag & _IOEOF)87 #endif88 #ifdef __CYGWIN__89 #define feof(p) __sfeof(p)90 #endif91 #ifdef SHP92 restore original macro... if you ever want to compile this code on bada93 91 #endif 94 92
Note: See TracChangeset
for help on using the changeset viewer.