X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fmain.cc;h=ba8c3acbbc7d21c7003493ac3f335c578b440c06;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=3c0f7ae88eb7a4f28a065d1555ff4ffcf9c07aa9;hpb=c8f35b49edadbef240fe3ad4931a6c9f526cc6d6;p=lilypond.git diff --git a/lily/main.cc b/lily/main.cc index 3c0f7ae88e..ba8c3acbbc 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1997--2007 Han-Wen Nienhuys + (c) 1997--2008 Han-Wen Nienhuys */ #include "main.hh" @@ -166,6 +166,29 @@ static Long_option_init options_static[] char const *LILYPOND_DATADIR = PACKAGE_DATADIR "/" TOPLEVEL_VERSION; + +/* x86 defaults to using 80-bit extended precision arithmetic. This can cause + problems because the truncation from 80 bits to 64 bits can occur in + unpredictable places. To get around this, we tell the x87 FPU to use only + double precision. Note that this is not needed for x86_64 because that uses + the SSE unit by default instead of the x87 FPU. */ +#if ((defined(__x86__) || defined(__i386__)) \ + && defined(HAVE_FPU_CONTROL_H) && (HAVE_FPU_CONTROL_H == 1)) + +#include +static void configure_fpu() { + fpu_control_t fpu_control = 0x027f; + _FPU_SETCW (fpu_control); +} + +#else + +static void configure_fpu() { +} + +#endif /* defined(__x86__) || defined(__i386__) */ + + static void env_var_info (FILE *out, char const *key) { @@ -201,7 +224,7 @@ static void copyright () { printf (_f ("Copyright (c) %s by\n%s and others.", - "1996--2007", + "1996--2008", AUTHORS).c_str ()); printf ("\n"); } @@ -217,9 +240,10 @@ static void notice () { identify (stdout); - puts (_f (NOTICE, PROGRAM_NAME).c_str ()); printf ("\n"); copyright (); + printf ("\n"); + puts (_f (NOTICE, PROGRAM_NAME).c_str ()); } LY_DEFINE (ly_usage, "ly:usage", @@ -534,7 +558,6 @@ parse_argv (int argc, char **argv) if (show_help) { - identify (stdout); ly_usage (); if (be_verbose_global) dir_info (stdout); @@ -569,6 +592,8 @@ vector start_environment_global; int main (int argc, char **argv, char **envp) { + configure_fpu(); + for (char **p = envp; *p; p++) start_environment_global.push_back(*p);