/* * NOTE: this is also used for opening text files. * WIN32 treats Control-Z as EOF in files opened in text mode. * Therefore, we open files in binary mode on Win32 so we can read * literal control-Z. The other affect is that we see CRLF, but * that is OK because we can already handle those cleanly. */ #if defined(WIN32) || defined(__CYGWIN__) #define PG_BINARY O_BINARY #define PG_BINARY_A "ab" #define PG_BINARY_R "rb" #define PG_BINARY_W "wb" #else #define PG_BINARY 0 #define PG_BINARY_A "a" #define PG_BINARY_R "r" #define PG_BINARY_W "w" #endif
switch (DoTrace(cs)) { case ENABLE_TRACE: cs->framep->level |= TRACE_ON; if (!TRACING) break; [[fallthrough]]; // 不跳出 switch,继续下一个case case DO_TRACE: if (TRACING) { if (!cs->locked) native_mutex_lock(&THR_LOCK_dbug); DoPrefix(cs, _line_); Indent(cs, cs->level); (void)fprintf(cs->stack->out_file, ">%.*s\n", cs->func_len, cs->func); DbugFlush(cs); /* This does a unlock */ } break; case DISABLE_TRACE: cs->framep->level &= ~TRACE_ON; [[fallthrough]]; case DONT_TRACE: break; }
int _tmain(int argc, _TCHAR* argv[]) { SetColor(40,30); std::cout < <"Colored hello world for windows!\n"; SetColor(120,20); std::cout <<"Colored hello world for windows!\n"; SetColor(10,50); std::cout <<"Colored hello world for windows!\n"; return0; }