Changeset 15089


Ignore:
Timestamp:
05/23/13 20:50:29 (12 years ago)
Author:
Eric.Larour
Message:

CHG: starting transition to better print i/o

Location:
issm/trunk-jpl/src/c/shared/io/Print
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/shared/io/Print/Print.h

    r14910 r15089  
    2424/*}}}*/
    2525/* _printLine_ {{{*/
    26 /* macro to print a line, adds std::endl */
     26/* macro to print a line, adds std::endl, only on cpu 0 */
    2727#define _printLine_(StreamArgs)\
    28    do{std::cout << StreamArgs << std::endl;}while(0)
     28  do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
     29          aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
     30          PrintfFunction3(aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
    2931/*}}}*/
    3032/* _printString_ {{{*/
    31 /* macro to print some string */
     33/* macro to print some string. Only on cpu0 */
    3234#define _printString_(StreamArgs)\
    33    do{std::cout << StreamArgs;}while(0)
     35  do{std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \
     36          aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \
     37          PrintfFunction4(aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy.str());}while(0)
    3438/*}}}*/
    3539/* _pprintLine_ {{{*/
     
    5256int PrintfFunction(const string & message);
    5357int PrintfFunction2(const string & message);
     58int PrintfFunction3(const string & message);
     59int PrintfFunction4(const string & message);
    5460
    5561#endif 
  • issm/trunk-jpl/src/c/shared/io/Print/PrintfFunction.cpp

    r14950 r15089  
    8787        return 1;
    8888}
     89int PrintfFunction3(const string & message){
     90
     91        #ifdef _HAVE_ANDROID_JNI_
     92        __android_log_print(ANDROID_LOG_INFO, "Native",message.c_str());
     93        #else
     94        printf("%s\n",message.c_str());
     95        #endif
     96
     97        return 1;
     98}
     99int PrintfFunction4(const string & message){
     100
     101        printf("%s",message.c_str());
     102
     103        return 1;
     104}
Note: See TracChangeset for help on using the changeset viewer.