Exception Handling



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 09/12/2002 at 15:26, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   8.012 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    I am converting from R7 to R8, and I use containers from the Standard Template Library (STL). This requires exception handling. However, if I check "Enable Exception Handling" in the Project Settings for C++ Language, I get compile warnings for the use of gNew.
    Do you have any suggestions how I can get this to work together?
    Thank you,
    Jane



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 09/12/2002 at 22:58, xxxxxxxx wrote:

    The compiler error suggests what to do, so just add these to c4d_memory.h:

        
        
        void operator delete(void *p,int line,const CHAR *file);  
        void operator delete[](void *p,int line,const CHAR *file);
    

    And these to c4d_memory.cpp:

        
        
        void operator delete(void *p, int line,const CHAR *file)  
        {  
          delete p;  
        }  
          
        void operator delete[](void *p, int line,const CHAR *file)  
        {  
          delete p;  
        }
    

    Otherwise the gNew operator is exception unsafe in debug mode as reported (warning C4291).



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 10/12/2002 at 12:29, xxxxxxxx wrote:

    Do you plan to add these to the API permanently?
    Thanks,
    Jane



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 10/12/2002 at 13:49, xxxxxxxx wrote:

    That's not for me to say or decide, but I can just say that the above was a direct cut and paste from a previous internal bug report of mine on the subject... :-)
    If you don't want to change the API you can probably also place them in one of your own files. (This way you won't have to redo the changes with new API versions.)


Log in to reply