Jump to content

darrenhoffman

Community Members
  • Posts

    9
  • Joined

  • Last visited

darrenhoffman's Achievements

Tiro

Tiro (1/14)

0

Reputation

  1. I just built 0ad for the first time on my Windows system and when I tried to run the pyrogenesis_dbg.exe I got the exact same error. I'm running a 32-bit version of Vista on a core2 duo: System info: (generated 2010-06-24 20:48:09 UTC) OS : Vista SP 2 (6.0.6002) CPU : IA-32, Intel Core2 Duo T8300 @ 2.40GHz (1x2x1), 2.39 GHz Memory : 2046 MiB; 852 MiB free Graphics Card : NVIDIA Quadro NVS 135M OpenGL Drivers : 2.1.2; Video Mode : 1024x768:32 Sound Card : SigmaTel High Definition Audio CODEC Sound Drivers : OpenAL32.dll (unknown)
  2. http://trac.wildfiregames.com/ticket/495 I wrote a function that I think takes care of the basic problem, but I'm probably doing a number of things incorrectly, at least style-wise if not logic-wise. For instance I'm not sure that I should be sending all the output to std::cout, and whether I should be calling the exit() function rather than throwing an exception or something. Also, setenv isn't thread safe, but maybe that's not a concern in the init code? I just don't know enough yet to know. So, I'm going to try and take a look at some of the source code and hopefully I'll learn some more, but in the mean time, if anyone would like to look at my code here, and feel free to offer any suggestions whatsoever, I'd appreciate it. void SetDefaultIfLocaleInvalid() { // I don't believe $LANGUAGE needs to be included because it isn't checked // by setlocale() nor std::locale::locale(const chr*). // LC_ALL is checked first, and LANG last. const char* const LocaleEnvVars[] = {"LC_ALL", "LC_COLLATE", "LC_CTYPE", "LC_MONETARY", "LC_NUMERIC", "LC_TIME", "LC_MESSAGES", "LANG"}; const size_t SZ = sizeof LocaleEnvVars / sizeof *LocaleEnvVars; try { // this constructor is similar to setlocale(LC_ALL, ""), // but instead of returning NULL, it throws runtime_error // when the first locale env variable found contains an invalid value std::locale::locale(""); } catch (std::runtime_error& e) { std::cout << "Warning: Invalid Locale Settings:\n"; for (size_t i = 0; i < SZ; i++) { std::cout << "\t\t" << LocaleEnvVars[i] << "="; if (char* envval = getenv(LocaleEnvVars[i])) { std::cout << "\"" << envval << "\""; } else { std::cout << "(unset)"; } std::cout << std::endl; }//end for i // The Boost filesystem library uses std::locale::locale("") // so I believe we should set the LC_ALL env variable to something // appropriate, std::locale::classic().name() (should be "C") // seems best to me. // We should set LC_ALL since it overrides LANG if (setenv("LC_ALL", std::locale::classic().name().c_str(), 1)) { std::cout << "Error: Unable to set LC_ALL env variable." << std::endl; exit(EXIT_FAILURE); } std::cout << "\tSetting LC_ALL env variable to: " << std::locale::classic().name() << std::endl; } // end catch return; }
  3. I also had some trouble checking out with svn. I had to try a few times before it succeeded completely.
×
×
  • Create New...