You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "pengzhouhu (Jira)" <ji...@apache.org> on 2019/08/27 10:46:00 UTC

[jira] [Updated] (THRIFT-4941) thrift compiler will not auto update gen-cpp directory

     [ https://issues.apache.org/jira/browse/THRIFT-4941?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

pengzhouhu updated THRIFT-4941:
-------------------------------
    Description: 
hi ,Jens:

    thrift compiler will not auto update gen-cpp directory.

     when we call  t_generator::generate_program() and init_generator() in compiler\cpp\src\thrift\generate\t_generator.cc ,  #define MKDIR(x) will ignore EEXIST, throw on any other error, this will not give any reponse print on terminal. 
     used to be update the whole directory.
     code details:

{code:java}
// ignore EEXIST, throw on any other error
#ifdef _WIN32
#define MKDIR(x) { int r = _mkdir(x); if (r == -1 && errno != EEXIST) { throw (std::string(x) + ": ") + strerror(errno); } }
#else
#define MKDIR(x) { int r = mkdir(x, S_IRWXU | S_IRWXG | S_IRWXO); if (r == -1 && errno != EEXIST) { throw (std::string(x) + ": ") + strerror(errno); } }
#endif
{code}

Thanks.
Zhouhu.

  was:
hi , Gens:

    thrift compiler will not auto update gen-cpp directory.

     when we call  t_generator::generate_program() and init_generator() in compiler\cpp\src\thrift\generate\t_generator.cc ,  #define MKDIR(x) will ignore EEXIST, throw on any other error, this will not give any reponse print on terminal. 
     used to be update the whole directory.
     code details:

{code:java}
// ignore EEXIST, throw on any other error
#ifdef _WIN32
#define MKDIR(x) { int r = _mkdir(x); if (r == -1 && errno != EEXIST) { throw (std::string(x) + ": ") + strerror(errno); } }
#else
#define MKDIR(x) { int r = mkdir(x, S_IRWXU | S_IRWXG | S_IRWXO); if (r == -1 && errno != EEXIST) { throw (std::string(x) + ": ") + strerror(errno); } }
#endif
{code}

Thanks.
Zhouhu.


> thrift compiler will not auto update gen-cpp directory
> ------------------------------------------------------
>
>                 Key: THRIFT-4941
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4941
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Compiler
>    Affects Versions: 0.13.0
>         Environment: 
>            Reporter: pengzhouhu
>            Priority: Major
>             Fix For: 0.13.0
>
>
> hi ,Jens:
>     thrift compiler will not auto update gen-cpp directory.
>      when we call  t_generator::generate_program() and init_generator() in compiler\cpp\src\thrift\generate\t_generator.cc ,  #define MKDIR(x) will ignore EEXIST, throw on any other error, this will not give any reponse print on terminal. 
>      used to be update the whole directory.
>      code details:
> {code:java}
> // ignore EEXIST, throw on any other error
> #ifdef _WIN32
> #define MKDIR(x) { int r = _mkdir(x); if (r == -1 && errno != EEXIST) { throw (std::string(x) + ": ") + strerror(errno); } }
> #else
> #define MKDIR(x) { int r = mkdir(x, S_IRWXU | S_IRWXG | S_IRWXO); if (r == -1 && errno != EEXIST) { throw (std::string(x) + ": ") + strerror(errno); } }
> #endif
> {code}
> Thanks.
> Zhouhu.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)