- Timestamp:
- 02/10/14 17:08:23 (11 years ago)
- Location:
- cpp/frams/virtfile
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/virtfile/virtfile.cpp
r121 r123 58 58 int fread(void *ptr, size_t size, size_t nmemb, VirtFILE* f) {return f->Vread(ptr,size,nmemb);} 59 59 int fwrite(const void *ptr, size_t size, size_t nmemb, VirtFILE* f) {return f->Vwrite(ptr,size,nmemb);} 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 63 #undef feof 64 #endif 65 66 int feof(VirtFILE* f) {return f->Veof();} 67 68 //...and then restore the original macro: 60 69 #ifdef __BORLANDC__ 61 #undef feof 70 #define feof(__f) ((__f)->flags & _F_EOF) 62 71 #endif 63 72 #ifdef _MSC_VER 64 #undef feof 73 #define feof(_stream) ((_stream)->_flag & _IOEOF) 74 #endif 75 #ifdef __CYGWIN__ 76 #define feof(p) __sfeof(p) 65 77 #endif 66 78 #ifdef SHP 67 #undef feof 79 restore original macro... if you ever want to compile this code on bada 68 80 #endif 69 int feof(VirtFILE* f) {return f->Veof();} 70 #ifdef __BORLANDC__ 71 #define feof(__f) ((__f)->flags & _F_EOF) 72 #endif 73 #ifdef _MSC_VER 74 #define feof(_stream) ((_stream)->_flag & _IOEOF) 75 #endif 81 76 82 77 83 int fputc(int c,VirtFILE* f) {return f->Vputc(c);} … … 95 101 int closedir(VirtDIR* d) {delete d; return 0;} 96 102 dirent* readdir(VirtDIR* d) {return d->Vreaddir();} 103 -
cpp/frams/virtfile/virtfile.h
r121 r123 70 70 DLLEXP int fread(void *ptr, size_t size, size_t nmemb, VirtFILE* f); 71 71 DLLEXP int fwrite(const void *ptr, size_t size, size_t nmemb, VirtFILE* f); 72 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 76 #undef feof 77 #endif 78 79 DLLEXP int feof(VirtFILE* f);// {return f->Veof();} 80 81 //...and then restore the original macro: 72 82 #ifdef __BORLANDC__ 73 #undef feof 83 #define feof(__f) ((__f)->flags & _F_EOF) 74 84 #endif 75 85 #ifdef _MSC_VER 76 #undef feof 86 #define feof(_stream) ((_stream)->_flag & _IOEOF) 87 #endif 88 #ifdef __CYGWIN__ 89 #define feof(p) __sfeof(p) 77 90 #endif 78 91 #ifdef SHP 79 #undef feof //not sure if this is OK since feof() is not defined below for bada, but it won't compile without this #undef. Same in virtfile.cpp 92 restore original macro... if you ever want to compile this code on bada 80 93 #endif 81 DLLEXP int feof(VirtFILE* f);// {return f->Veof();} 82 #ifdef __BORLANDC__ 83 #define feof(__f) ((__f)->flags & _F_EOF) 84 #endif 85 #ifdef _MSC_VER 86 #define feof(_stream) ((_stream)->_flag & _IOEOF) 87 #endif 94 88 95 89 96 DLLEXP int fputc(int c,VirtFILE* f);
Note: See TracChangeset
for help on using the changeset viewer.