//-------------------------------------------------------------------------- rpc_debmod_t::rpc_debmod_t(const char *default_platform) : rpc_client_t(NULL) { const register_info_t *regs = debugger.registers; nregs = debugger.registers_size; for ( int i=0; i < nregs; i++, regs++ ) { if ( (regs->flags & REGISTER_SP) != 0 ) sp_idx = i; if ( (regs->flags & REGISTER_IP) != 0 ) pc_idx = i; } bpt_code.append(debugger.bpt_bytes, debugger.bpt_size); rpc = this; set_platform(default_platform); }
void MsgNeighbor::MergeFrom(const MsgNeighbor& from) { GOOGLE_CHECK_NE(&from, this); neighbor_.MergeFrom(from.neighbor_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from._has_bit(0)) { set_platform(from.platform()); } if (from._has_bit(1)) { set_accountid(from.accountid()); } if (from._has_bit(2)) { set_score(from.score()); } if (from._has_bit(3)) { set_xp(from.xp()); } if (from._has_bit(4)) { set_extid(from.extid()); } if (from._has_bit(5)) { set_url(from.url()); } if (from._has_bit(6)) { set_name(from.name()); } if (from._has_bit(7)) { set_isneighbor(from.isneighbor()); } } if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { if (from._has_bit(8)) { set_levelbasedonscore(from.levelbasedonscore()); } if (from._has_bit(9)) { set_wishlist(from.wishlist()); } if (from._has_bit(10)) { set_damageprotectiontimeleft(from.damageprotectiontimeleft()); } if (from._has_bit(11)) { set_tutorialcompleted(from.tutorialcompleted()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); }
int main(int argc, const char *argv[]) { const char *p; char *t; int i; int ret; char buf[128]; for(i = 1; i < argc; i++) { p = argv[i]; if (*p != '-') add_source(p); else { switch(p[1]) { case 'V': verbose = 1; break; /* What are we doing */ case 'c': mode = MODE_OBJ; break; case 'E': mode = MODE_CPP; break; case 'S': mode = MODE_ASM; break; case 'v': printf("fcc: front end to sdcc\n"); add_argument("sdcc"); add_argument("-v"); do_command(); exit(0); case 'D': add_macro(p); break; case 'l': add_library(p+2); break; case 'L': if (p[2] == 0) add_library_path(argv[++i]); else add_library_path(p+2); break; case 'I': if (p[2] == 0) add_include_path(argv[++i]); else add_include_path(p+2); break; case 'o': if (p[2] == 0) set_target(argv[++i]); else set_target(p + 2); break; case 'O': set_optimize(p + 2); break; case 'm': if (p[2] == 0) set_cpu(argv[++i]); else set_cpu(p + 2); break; case 'M': if (p[2] == 0) set_map(argv[++i]); else set_map(p + 2); break; case 't': if (p[2] == 0) set_platform(argv[++i]); else set_platform(p + 2); break; case 'g': debug = 1; break; default: if (strcmp(p, "-Werror") == 0) werror = 1; else if (strcmp(p, "-funsigned-char") == 0) unschar = 1; else if (strcmp(p, "--pedantic") == 0) pedantic = 1; else if (strcmp(p, "--nostdio") == 0) nostdio = 1; else { fprintf(stderr, "fcc: Unknown option '%s'.\n", p); exit(1); } } } } add_include_path(FCC_DIR "/include/"); add_library_path(FCC_DIR "/lib/"); snprintf(buf, sizeof(buf), "c%s", platform); add_library(buf); if (mode == MODE_OBJ) { while (srchead) { build_command(); ret = do_command(); if (ret) break; if (mode == MODE_OBJ && target) { char *orel = filebasename(rebuildname("", srchead->p, "rel")); if (rename(orel, target) == -1) { fprintf(stderr, "Unable to rename %s to %s.\n", orel, target); perror(srchead->p); exit(1); } } srchead = srchead->next; argp = 0; } } else { build_command(); ret = do_command(); } if (mode != MODE_LINK || ret) exit(ret); argp = 0; add_argument("makebin"); add_argument("-p"); add_argument("-s"); add_argument("65535"); add_argument(target); add_argument(t = rebuildname("", target, "bin")); ret = do_command(); if (ret) exit(ret); argp = 0; add_argument(FCC_DIR "/bin/binman"); snprintf(buf, sizeof(buf), "%x", progbase); add_argument(buf); add_argument(t); add_argument(rebuildname("", target, "map")); add_argument(target); ret = do_command(); exit(ret); }
// ------------------------------------------------------------------ int main(int argc,char *argv[]) { bool info = false; bool usage = false; setup_configuration(); for (int i = 1; i < argc; i++) if (!strcmp(argv[i], "-info")) info = true; else if (!strncmp(argv[i], "--enable-", 9)) set(&argv[i][9], true); else if (!strncmp(argv[i], "--disable-", 10)) set(&argv[i][10], false); else if (!strncmp(argv[i], "--platform=", 11)) set_platform(&argv[i][11]); else if (!strncmp(argv[i], "--name=", 7)) replace_makefile("NAME", &argv[i][7]); else if (!strncmp(argv[i], "--prefix=", 9)) replace_makefile("PREFIX", &argv[i][9]); else if (!strncmp(argv[i], "--namespace=", 12)) set_namespace(&argv[i][12]); else if (!strcmp(argv[i], "-v")) any_set = true; else if (!strcmp(argv[i], "-q")) quiet = true; else if (*argv[i] == '-') { fprintf(stderr, "Unknown command line option: %s\n", argv[i]); usage = true; } else usage = true; if (usage) { fprintf(stderr, "Usage: %s [-info] [-v] [-h] [--platform=PLATFORM] [--prefix=<path>] [--name=<Name>] [--namespace=<ns>] [--enable-OPTION] [--disable-OPTION]\n", *argv); fprintf(stderr, "\n"); fprintf(stderr, "Options (default value)\n"); fprintf(stderr, "\n"); fprintf(stderr, " -info Show compiled options\n"); fprintf(stderr, " -v Show configuration options\n"); fprintf(stderr, " -q Don't show extra info\n"); fprintf(stderr, " -h Show this help\n"); fprintf(stderr, "\n"); fprintf(stderr, " --platform= Select target platform\n"); fprintf(stderr, " --prefix= Set installation path (/usr/local/$NAME)\n"); fprintf(stderr, " --name= Set library name (Sockets)\n"); fprintf(stderr, " --namespace= Set C++ namespace for entire library\n"); fprintf(stderr, "\n"); fprintf(stderr, "Defined platforms\n"); fprintf(stderr, "\n"); fprintf(stderr, " linux-x86-32\n"); fprintf(stderr, " linux-x86-64\n"); fprintf(stderr, " win32-cygwin\n"); fprintf(stderr, " solaris9-sparc-64\n"); fprintf(stderr, " macosx\n"); fprintf(stderr, " solaris8\n"); fprintf(stderr, "\n"); fprintf(stderr, "Possible OPTION values:\n"); fprintf(stderr, "\n"); fprintf(stderr, " openssl Enable openssl library\n"); fprintf(stderr, " ipv6 Add ipv6 support\n"); fprintf(stderr, " sctp Add SCTP support\n"); fprintf(stderr, " no_addrinfo Do not use addrinfo API for dns requests\n"); fprintf(stderr, " pool Enable client connection pool\n"); fprintf(stderr, " socks4 Enable socks4 client support\n"); fprintf(stderr, " resolver Enable asynchronous dns\n"); fprintf(stderr, " reconnect Enable tcp reconnect\n"); fprintf(stderr, " detach Enable detach functionality\n"); fprintf(stderr, " exceptions Enable C++ exceptions on some error conditions\n"); fprintf(stderr, " xml2 Enable libxml2 support\n"); fprintf(stderr, "\n"); fprintf(stderr, "Use with no options to show platform configuration options in CFLAGS format.\n"); return 0; } if (argc > 1 && info) { show_info(); return 0; } if (any_set) { if (!quiet) show_configuration(); return 0; } printf(" -D_VERSION='\"%s\"'", _VERSION); #ifdef LINUX printf(" -DLINUX"); #endif #ifdef MACOSX printf(" -DMACOSX"); #endif #ifdef SOLARIS printf(" -DSOLARIS"); #endif #ifdef SOLARIS8 printf(" -DSOLARIS8"); #endif #ifdef _WIN32 printf(" -D_WIN32"); #endif #ifdef __CYGWIN__ printf(" -D__CYGWIN__"); #endif #ifdef SOCKETS_NAMESPACE printf(" -DSOCKETS_NAMESPACE=%s", SOCKETS_NAMESPACE_STR); #endif #ifdef _DEBUG printf(" -D_DEBUG"); #endif }