Permalink
Commits on Mar 1, 2017
  1. doc: wiki snapshot

    dkl committed Mar 1, 2017
Commits on Feb 28, 2017
  1. fbdoc: Remove inconsistent custom TRUE/FALSE #defines

    and rely on FB built-in true/false instead.
    dkl committed Feb 28, 2017
  2. fbdoc: Solve out checks against TRUE

    dkl committed Feb 28, 2017
  3. fbdoc: Fix pcre usage for 64bit

    dkl committed Feb 28, 2017
  4. fbhelp: Fix Next var typo

    From: mandian <mandian@users.sf.net>
    dkl committed Feb 28, 2017
Commits on Feb 4, 2017
Commits on Feb 2, 2017
  1. inc: winapi: Fix winnt.h SECURITY_*_AUTHORITY initializers

    They're initializers for SID_IDENTIFIER_AUTHORITY which is a UDT
    containing a byte array.
    dkl committed Feb 2, 2017
Commits on Feb 1, 2017
  1. Stop using Common Shared in fbc sources

    Dim Shared/Extern is better because it doesn't rely on linker tricks
    to work.
    dkl committed Feb 1, 2017
  2. tests: Fix namespace/cpp for 64bit

    dkl committed Feb 1, 2017
  3. Fix compiler crash on type<>() initializer for non-UDT global var

    1. astTypeIniIsConst/hExprIsConst wanted to do checks against the global
    var symbol when checking a global var init, however the TYPEINI sym can be
    NULL in case of something like type<integer>(0), so it crashed. To fix it,
    I moved the checks out of astTypeIniIsConst. astLoadStaticInitializer/
    hFlushExprStatic had a similar problem, but since the basesym is passed
    there next to the TYPEINI, it's easier to fix.
    (Normally a TYPEINI like type<integer>(0) would have a temp var sym, but
    global var inits aren't processed by astTypeIniUpdate.)
    
    2. Refactor code in parser-decl-var.bas to use same global var init
    validation checks for both Dim and Var.
    dkl committed Feb 1, 2017
Commits on Oct 24, 2016
  1. WCHR: safe to evaluate at compile time even if target has a different…

    … sizeof(wstring)
    
    See #840 for explication.
    rversteegen committed Oct 24, 2016
  2. Fix WCHR bug where internal buffers were not large enough, overflowin…

    …g on characters > &hffffff or lots of arguments
    
    ws in cStrCHR was too short even to handle 32 16 bit characters, let alone
    32 unicode codepoints (&h10ffff) or 32 32-bit values.
    
    This also completes the fix in the previous commit.
    rversteegen committed Oct 24, 2016
  3. Fix bug preventing WCHR from producing characters above &h3ffff when …

    …evaluated at compile time.
    
    Note: the testcases don't all pass because there is a second bug in
    WCHR preventing characters above &hffffff from working, fixed in next commit.
    rversteegen committed Oct 24, 2016
  4. Update many testcases to work on ARM and DOS/8-bit-wstring platforms

    Tests now check sizeof(wstring) instead of the platform, except for
    quirk/len-sizeof.bas, which checks sizeof(wstring) is as expected on
    each platform. Likewise cleanup alignment checking.
    
    The following testcases still fail on ARM (when emulated in QEMU):
    
    Suite fbc_tests.optimizations.consteval, Test uop double had failures:
        1. optimizations/consteval.bas:338  - CU_ASSERT_DOUBLE_EQUAL(exp( 1.0 ),exp( d ),EPSILON_DBL)
        2. optimizations/consteval.bas:338  - CU_ASSERT_DOUBLE_EQUAL(exp( d ),exp( 1.0 ),EPSILON_DBL)
    Suite fbc_tests.optimizations.consteval, Test math bop double had failures:
        1. optimizations/consteval.bas:422  - CU_ASSERT_DOUBLE_EQUAL(d3,d4,EPSILON_DBL)
    Suite fbc_tests.string.print_using, Test inf/nan/ind printing test had failures:
        1. string/print_using.bas:403  - CU_ASSERT_EQUAL(sResult,sExpected)
        (etc)
    
    The exp tests fail because the error is two epsilons. Line 422 tests pow(),
    which is 8 epsilons out.
    The print_using tests fail because of differences in whether the CPU produces
    positive or negative NaN (which is not standardised by IEEE) and some INDs
    being NANs instead. It doesn't appear practical to do anything about it.
    rversteegen committed with dkl Oct 24, 2016
  5. tests: fix the ability to cross-compile from/to win32/dos

    TARGET_OS can now be determined from TARGET, and there are separate
    EXEEXT and TARGET_EXEEXT
    rversteegen committed with dkl Oct 23, 2016
  6. tests: Add TARGET config option to makefile. Only tested for cunit tests

    This allows cross-compiling the fbc-tests binary. make still tries running
    the built binary regardless.
    
    I renamed the previous TARGET variable to TARGET_OS, and cleaned up
    common.mk a bit (bad indentation; 'unix' is now used instead of 'linux').
    rversteegen committed with dkl Oct 18, 2016
Commits on Oct 23, 2016
  1. Fix wstring constant merging check to calculate buffer size correctly

    We check the internal string length to see whether we can use hEscapeW().
    Since all this is internal and based on the host Wstring type, we have to
    check against host Wstring size.
    dkl committed Oct 23, 2016
Commits on Oct 5, 2016
  1. Remove stray $ from log-tests makefile

    (caused MSYS2 make on Win32 to show an error)
    dkl committed Oct 5, 2016
  2. Fix surrogate pair truncation in UTF32 -> Windows WString conversion

    Make the UTF32 -> Windows WString case consistent with other UTF32 -> UTF16
    cases in FB rtlib: When the destination buffer is too small to hold a
    surrogate pair, only the low (second) surrogate is written, and the high
    (first) surrogate is omitted.
    
    This is pretty strange (producing invalid UTF16 instead of failing),
    so I don't want to document this in detail (it should probably be changed),
    but at least FB's UTF16-generation cases are now consistent with regards
    to the handling of truncating surrogate pairs.
    
    Previously this code just wrote the low 16bit of the code point, which is
    invalid aswell.
    dkl committed Oct 5, 2016
  3. Fix bad surrogate pair values when converting UTF32 to UTF16

    UTF16_HALFBASE wasn't subtracted from the codepoint before splitting into
    high and low surrogate values, resulting in bad high surrogate. This bug
    only existed in conversions from UTF32; the code for conversions from UTF8
    did it correctly already.
    
    http://www.freebasic.net/forum/viewtopic.php?p=225217#p225217
    dkl committed Oct 5, 2016
Commits on Oct 1, 2016
  1. Ensure to truncate 32bit jump table index to 32bit

    astBuildJMPTB() calculated -minval * env.pointersize with
    minval=&hFFFFFFFFll, resulting in &hFFFFFFFC00000004. This must be
    truncated to 32bit to get the wanted result of 4. The value is later
    assigned to some Integer in emit_x86.bas or somewhere else, so it happened
    to work in 32bit fbc, but not in 64bit fbc.
    
    The solution is to ensure to truncate this precomputed index offset to
    32bit in case of 32bit Select Case As Const.
    
    Ideally the ASM backend would behave the same for 32bit and 64bit (i.e. use
    LongInts instead of Integers), but that's a different issue.
    
    Test case for 64bit fbc cross-compiling to 32bit:
      select case as const 0u
      case -1
      end select
    
      jmp dword ptr [.LT_0008+eax*4-17179869180]
    
      1.asm:31: Error: value of -17179869116 too large for field of 4 bytes at 60
    dkl committed Oct 1, 2016
  2. Fix code generation for SELECT CONST with CASE -1 on 64bit

    fbc used a For loop like "For value As ulongint = minval To maxval",
    but this fails (infinite loop) in case maxval = &hFFFFFFFFFFFFFFFFull,
    which happens when for example Case -1 is used in the Select Case As Const.
    
    The bad code existed in both ASM and C backends, but since it only affects
    64bit (because on 32bit, the Case values are truncated to 32bit UInteger,
    which fits into ULongInt just fine), the ASM backend doesn't trigger the
    issues.
    
    http://www.freebasic.net/forum/viewtopic.php?p=225109#p225109
    dkl committed Oct 1, 2016
Commits on Sep 11, 2016
  1. Unix rtlib: Use PTHREAD_MUTEX_RECURSIVE without _NP

    Looks like glibc provides PTHREAD_MUTEX_RECURSIVE under _GNU_SOURCE.
    Other libcs like musl only provide PTHREAD_MUTEX_RECURSIVE.
    dkl committed Sep 11, 2016
Commits on Aug 27, 2016
  1. doc: Disable user input query for "make refresh"

    This allows "make refresh" to be used on build servers.
    dkl committed Aug 27, 2016
Commits on Aug 26, 2016
  1. rtlib: Remove use of "long double" __builtin_floorl/fabsl

    - With latest DJGPP setup (DJGPP 2.05 and current gcc), __builtin_floorl()
      results in a call to floorl() but that isn't provided by DJGPP.
    - I don't think it's necessary to use the "long double" functions here,
      the "double" versions should be good enough.
    dkl committed Aug 26, 2016