Changeset 425 for cpp/common


Ignore:
Timestamp:
08/27/15 00:05:32 (9 years ago)
Author:
Maciej Komosinski
Message:

The NO_STD_IN_OUT_ERR macro excludes entire functions, not their contents

Location:
cpp/common/virtfile
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/virtfile/stdiofile.cpp

    r375 r425  
    88#include <common/log.h>
    99#include <common/Convert.h>
     10#ifdef __ANDROID__
     11#include <common/dirs.h>
     12#include <common/platform/android/AndroidAPK_DIR.h>
     13#endif
    1014
    1115VirtFILE* StdioFileSystem::Vfopen(const char *path, const char *mode)
     
    2428{
    2529        //log_printf("Vopendir %s",path);
     30#ifdef __ANDROID__
     31        int resources_prefix_length=getAppResourcesDir().length();
     32        if (strncmp(path, getAppResourcesDir().c_str(), resources_prefix_length) == 0) //it is a resources dir
     33        {
     34                VirtDIR *vd = AndroidAPK_DIR::opendir(path+resources_prefix_length+1); //+1 because we also skip '/' and start with a "relative" dir, otherwise it does not work.
     35                return vd;
     36        }
     37#endif
     38
    2639#ifdef _WIN32
    2740        DIRTYPE *d = wopendir(Convert::utf8ToUtf16(path).c_str());
     
    3851}
    3952
     53#ifndef NO_STD_IN_OUT_ERR
    4054void StdioFILE::setStdio()
    4155{
    42 #ifndef NO_STD_IN_OUT_ERR
    4356        static StdioFILEDontClose si(stdin);
    4457        static StdioFILEDontClose so(stdout);
     
    4760        setVstdout(&so);
    4861        setVstderr(&se);
     62}
    4963#endif
    50 }
    5164
    5265dirent* StdioDIR::Vreaddir()
  • cpp/common/virtfile/stdiofile.h

    r299 r425  
    2828        StdioFILE(MFILE *f):VirtFILE("") { file = f; }
    2929        StdioFILE(MFILE *f, const char* p):VirtFILE(p) { file = f; }
     30#ifndef NO_STD_IN_OUT_ERR
    3031        static void setStdio();
     32#endif
    3133        size_t Vread(void *ptr, size_t size, size_t nmemb) { return mfread(ptr, size, nmemb, file); }
    3234        size_t Vwrite(const void *ptr, size_t size, size_t nmemb) { return mfwrite(ptr, size, nmemb, file); }
     
    4850        StdioFILE(FILE *f):VirtFILE("") { file = f; }
    4951        StdioFILE(FILE *f, const char* p):VirtFILE(p) { file = f; }
     52#ifndef NO_STD_IN_OUT_ERR
    5053        static void setStdio();
     54#endif
    5155        size_t Vread(void *ptr, size_t size, size_t nmemb) { return fread(ptr, size, nmemb, file); }
    5256        size_t Vwrite(const void *ptr, size_t size, size_t nmemb) { return fwrite(ptr, size, nmemb, file); }
Note: See TracChangeset for help on using the changeset viewer.