…sults bug from 6490c31 Only fb_StrDelete() was being used to delete ignored string results, but that actually doesn't free the temporary descriptors used for string function results, but only the string data. The descriptors were leaked and can easily be exhausted - the rtlib only has 256. Solution: call fb_hStrDelTemp() instead, as done in lots of rtlib code.
This also solves a cyclic dependency with crt/win32/wchar.bi which itself #includes crt/stdint.bi.
This reverts commit e438f7f. Enums have special behaviour when inside Extern blocks: Normally they create a namespace to hold the enumconstants, but inside an Extern block, they don't create that namespace. This means normally enumconstants won't conflict with other global symbols or those from parallel enums, but inside Extern blocks they behave like enums in C and are added to the toplevel namespace, possibly conflicting with other globals. I don't like that enums have special behaviour in Extern blocks, but currently there's no alternative to get the C-style behaviour where enumconstants are added to the toplevel namespace. The change has caused problems with FB bindings to C libraries, for example here: http://www.freebasic.net/forum/viewtopic.php?f=14&t=22147 and it's best to revert it for now. The reason why this caused problems with code like this: enum foo = 1 end enum type foo as integer print foo '' error: Variable not declared, foo is that during symbol lookup, the type "foo" shadows the enumconstant "foo" which is imported from the enum's implicit namespace via the implicit USING done by enums. The same can be observed when using explicit namespaces: namespace aaa foo = 1 end namespace using aaa type foo as integer print foo '' error: Variable not declared, foo In other words, the lookup allows a type to shadow a constant, even though types and constants/variables/procedures are usually treated as being in separate namespaces (we can declare a type A and a variable A without duplicate definition error). But it works like that in C++ too, and is a whole different issue, not just related to enums... Conflicts: changelog.txt
symbGetMangledName() could add abbreviations and leave them in the list when mangling an UDT, because that didn't use symbMangleEndAbbrev(). Then if a procedure would be mangled next, it could see those abbreviations in the list, because even though it used symbMangleInitAbbrev(), that did only reset the counter, but not the list. Thus we'd end up with "ghost" abbreviations in the list, and new abbreviations could be assigned the same id as those ghost ones. Then the lookup would just use whichever is first... This was the cause of the issue reported here: http://www.freebasic.net/forum/viewtopic.php?f=3&t=22533 and it seems to happen since eca05cc when compiling with -gen gcc. It doesn't happen under -gen gas because that does not use symbGetMangledName() as much (in fact it probably doesn't mangle UDTs at all, thus side-stepping the issue).
allowing it to work with 64bit Integers too.
It is really the ptr field that holds the buffer containing the array elements, so it makes sense to give it the array dtype. In fact, doing this for the ptr field makes more sense than doing it for the data field, because the data field may not point to the array data directly (due to the "diff" difference). http://www.freebasic.net/forum/viewtopic.php?p=197586#p197586
- bydesc array parameter dimensions weren't being encoded (e.g. array() and array(any), or array(any) and array(any, any) were seen as the same) - Function result CONSTness wasn't encoded, and will be encoded now. This means two function pointers that differ only in function result CONSTness are seen as different now. This matches the overloading rules and the C++ mangling. - BYVAL parameter CONSTness was encoded, and will no longer be encoded now. Two function pointers that differ only in a BYVAL parameter that's CONST in one and non-CONST in the other, are now seen as the same type, as in C++. Overloading isn't allowed based on BYVAL parameter CONSTness either, and the C++ mangling ignores BYVAL parameter CONSTness too.
instead of checking stdin by default - seems more logical & more commonly needed.