Changeset 5065 for pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app_legacy.c
- Timestamp:
- Apr 13, 2015 12:14:02 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app_legacy.c
r4851 r5065 24 24 #define THIS_FILE "pjsua_app_legacy.c" 25 25 26 27 /* An attempt to avoid stdout buffering for python tests: 28 * - call 'fflush(stdout)' after each call to 'printf()/puts()' 29 * - apply 'setbuf(stdout, 0)', but it is not guaranteed by the standard: 30 * http://stackoverflow.com/questions/1716296 31 */ 32 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ 33 (defined (_MSC_VER) && _MSC_VER >= 1400) 34 /* Variadic macro is introduced in C99; MSVC supports it in since 2005. */ 35 # define printf(...) {printf(__VA_ARGS__);fflush(stdout);} 36 # define puts(s) {puts(s);fflush(stdout);} 37 #endif 38 39 26 40 static pj_bool_t cmd_echo; 27 41 … … 39 53 pjsua_enum_buddies(ids, &count); 40 54 41 if (count == 0) 55 if (count == 0) { 42 56 puts(" -none-"); 43 else {57 } else { 44 58 for (i=0; i<(int)count; ++i) { 45 59 pjsua_buddy_info info; … … 1089 1103 } 1090 1104 if (result.nb_result != PJSUA_APP_NO_NB) { 1091 if (result.nb_result == -1 || result.nb_result == 0) 1105 if (result.nb_result == -1 || result.nb_result == 0) { 1092 1106 puts("You can't do that with transfer call!"); 1093 else {1107 } else { 1094 1108 pjsua_buddy_info binfo; 1095 1109 pjsua_buddy_get_info(result.nb_result-1, &binfo); … … 1670 1684 } 1671 1685 1686 1672 1687 /* 1673 1688 * Main "user interface" loop.
Note: See TracChangeset
for help on using the changeset viewer.