Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

Update to latest swig version (3.0.12 as of 5/10/2017) #1292

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions external/Swig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
# SWIG_DIR: the directory where swig is installed (.i files, etc.) as defined
# by FindSWIG.

set(swig_path "${REPOSITORY_DIR}/external/common/src/swig-3.0.2.tar.gz")
set(swig_path "${REPOSITORY_DIR}/external/common/src/swig-3.0.12.tar.gz")
set(pcre_path "${REPOSITORY_DIR}/external/common/src/pcre-8.37.tar.gz")

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
# We bundle pre-built Swig for Windows (presumably because we can't build it?)
add_custom_target(Swig)
set(swig_executable
${PROJECT_SOURCE_DIR}/${PLATFORM}${BITNESS}${PLATFORM_SUFFIX}/bin/swig.exe)
set(swig_dir ${PROJECT_SOURCE_DIR}/common/share/swig/3.0.2)
set(swig_dir ${PROJECT_SOURCE_DIR}/common/share/swig/3.0.12)
else()
# Build Swig from source on non-Windows (e.g., Linux and OS X)
ExternalProject_Add(
Expand All @@ -49,7 +49,7 @@ else()
${EP_BASE}/Source/Swig/configure --prefix=${EP_BASE}/Install --enable-cpp11-testing
)
set(swig_executable ${EP_BASE}/Install/bin/swig)
set(swig_dir ${EP_BASE}/Install/share/swig/3.0.2)
set(swig_dir ${EP_BASE}/Install/share/swig/3.0.12)
endif()

set(SWIG_EXECUTABLE ${swig_executable} PARENT_SCOPE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
%include <lua/luakw.swg>
%include <ocaml/ocamlkw.swg>
%include <perl5/perlkw.swg>
%include <php5/phpkw.swg>
%include <php/phpkw.swg>
%include <pike/pikekw.swg>
%include <python/pythonkw.swg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
%{
static TYPE *new_##NAME(int nelements) { %}
#ifdef __cplusplus
%{ return new TYPE[nelements]; %}
%{ return new TYPE[nelements](); %}
#else
%{ return (TYPE *) calloc(nelements,sizeof(TYPE)); %}
#endif
Expand Down Expand Up @@ -81,7 +81,7 @@ typedef struct {

#ifdef __cplusplus
NAME(int nelements) {
return new TYPE[nelements];
return new TYPE[nelements]();
}
~NAME() {
delete [] self;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,20 @@ typedef struct SWIGCDATA {
}
%typemap(in) (const void *indata, int inlen) = (char *STRING, int LENGTH);

#elif SWIGPHP
#elif SWIGPHP5

%typemap(out) SWIGCDATA {
ZVAL_STRINGL($result, $1.data, $1.len, 1);
}
%typemap(in) (const void *indata, int inlen) = (char *STRING, int LENGTH);

#elif SWIGPHP7

%typemap(out) SWIGCDATA {
ZVAL_STRINGL($result, $1.data, $1.len);
}
%typemap(in) (const void *indata, int inlen) = (char *STRING, int LENGTH);

#elif SWIGJAVA

%apply (char *STRING, int LENGTH) { (const void *indata, int inlen) }
Expand Down Expand Up @@ -64,8 +71,6 @@ static jbyteArray SWIG_JavaArrayOutCDATA(JNIEnv *jenv, char *result, jsize sz) {
return $jnicall;
}

#else
%echo "cdata.i module not supported."
#endif


Expand Down
3 changes: 3 additions & 0 deletions external/common/share/swig/3.0.12/chicken/extra-install.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
swigclosprefix.scm
multi-generic.scm
tinyclos-multi-generic.patch
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ CSHARP_ARRAYS(long long, long)
CSHARP_ARRAYS(unsigned long long, ulong)
CSHARP_ARRAYS(float, float)
CSHARP_ARRAYS(double, double)
CSHARP_ARRAYS(bool, bool)


%define CSHARP_ARRAYS_FIXED( CTYPE, CSTYPE )
Expand Down Expand Up @@ -134,4 +135,5 @@ CSHARP_ARRAYS_FIXED(long long, long)
CSHARP_ARRAYS_FIXED(unsigned long long, ulong)
CSHARP_ARRAYS_FIXED(float, float)
CSHARP_ARRAYS_FIXED(double, double)
CSHARP_ARRAYS_FIXED(bool, bool)

Loading