long long[] map was using JNI type as C/C++ type. General spirit of
JAVA_ARRAYS_TYPEMAPS is to cast individual array elements, not to
rely on potentially incompatible pointer casts.
As for __int64 definition. __int64 is a non-standard Visual-C-specific
type used in win32/jni_md.h. It is defined by other Win32 compilers in
one way or another, obviously for compatibility. It's more appropriate
to give the compiler a chance to make necessary arrangements instead
of reinventing the wheel. This, giving a chance, can be achieved by
including virtually any standard header. Since jni.h includes stdio.h,
defining __int64 in javahead.swg is redundant. Since doing so actually
triggers compilation errors on MinGW if a system header is included
in the %begin section, it's arguably appropriate to omit it.
As for #undef _LP64 removal. Undefining a pre-defined macro, which
_LP64 is, is bad style, and if followed by inclusion of systems
headers, it's actually error-prone. Log suggests that it was added
to resolve a warning. I'm inclined to believe that it rather was a
misunderstanding of some kind. Or a bug in warning subsystem of
some particular compiler version, in which case it would have been
more appropriate to advise users to ignore the warning.
Reportedly the code we were using in the directorin case gave segfaults
in PHP 7.2 and later - we've been unable to reproduce these, but the new
approach is also simpler and should be bit faster too.
Fixes#1527, #1975
PHP already provides all the wrapped constants and all the wrapped
functions except fabs() (PHP provides abs() instead). Rewrapping
the constants causes warnings or errors (depending on PHP version)
and the rewrapped functions seem to be hidden by the built-in
versions, so only wrap fabs() for PHP.
(Even a wrapper for fabs() seems of little use since abs() is already
provided, but really math.i seems of little use more generally since
any general purpose programming language will provide its own maths
functions and constants - the key motivation here is to eliminate
warnings and errors from running the testsuite.)
Add testcase for previous commit.
Add missing assert for future type conversions support that will use
the heap instead of pointer casts (for smart pointer type conversions).
Closes#1963
* array_fix:
add javascript_arays.i fix to changes file
Convert javascript_arrays.i example into testcase
Update .gitignore for java doxygen output
Javascript code formatting corrections
Fix Javascript arrays for modern node versions
Fix for new SWIGV8_ARRAY_NEW definition
Proper array typemaps in Javascript