~ubuntu-branches/ubuntu/saucy/luatex/saucy

« back to all changes in this revision

Viewing changes to source/texk/web2c/luatexdir/lua51/luaconf.h

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2009-12-25 09:47:05 UTC
  • mfrom: (1.1.9 upstream) (4.2.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091225094705-y33rpflo8t4u9nag
Tags: 0.50.0-1
* new upstream release
* disable fix-hurd-ftbfs patch, included upstream
* disable upstram-fixes, included upstream
* disable ubuntu_libpoppler-0.11, not needed anymore

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
#define LUA_DL_DYLD             /* does not need extra library */
45
45
#endif
46
46
 
 
47
#if !defined(_WIN32)
 
48
#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
 
49
#endif
47
50
 
48
51
 
49
52
/*
521
524
#define LUA_NUMBER_SCAN         "%lf"
522
525
#define LUA_NUMBER_FMT          "%.14g"
523
526
 
524
 
#define lua_number2str(s,n)       if (((n)<0.000001) && ((n)>-0.000001))  \
525
 
        sprintf((s), "0"); else if (((n)<0.0001) && ((n)>-0.0001)) {      \
526
 
          sprintf((s), "%.6f", (n));                                      \
527
 
          if (n>0) { if (s[7] == '0') { s[7] = 0; } }                     \
528
 
          else     { if (s[8] == '0') { s[8] = 0; } }                     \
529
 
        } else  sprintf((s), LUA_NUMBER_FMT, (n)); 
530
 
 
531
 
 
532
 
#define LUAI_MAXNUMBER2STR      32 /* 16 digits, sign, point, and \0 */
 
527
#define lua_number2str(s,n) do {                                        \
 
528
        if (n<0.0001 && n>=-0.0001) {                           \
 
529
            sprintf((s), "%.14f", (n));                                 \
 
530
            if (strchr(s,'.')) {                                        \
 
531
                size_t s_l ;                                            \
 
532
                s_l = strlen(s);                                        \
 
533
                while (s_l>0 && s_l--) {                                \
 
534
                    if (s[s_l] == '0') s[s_l] = '\0';                   \
 
535
                    else break;                                         \
 
536
                }                                                       \
 
537
                if (s[s_l] == '.') s[s_l] = '\0';                       \
 
538
            }                                                           \
 
539
        } else sprintf((s), LUA_NUMBER_FMT, (n));                       \
 
540
    } while (0)
 
541
 
 
542
 
 
543
#define LUAI_MAXNUMBER2STR      64 /* 16 digits, sign, point, and \0 */
533
544
#define lua_str2number(s,p)     strtod((s), (p))
534
545
 
535
546