fix for long long types and old Tcl versions
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7304 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
3c361ac244
commit
a3c5c637b8
2 changed files with 18 additions and 6 deletions
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include <tcl.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <ctype.h>
|
||||
|
|
|
|||
|
|
@ -492,12 +492,23 @@
|
|||
}
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_INTEGER)
|
||||
long long, unsigned long long,
|
||||
const long long &, const unsigned long long &
|
||||
{
|
||||
Tcl_WideInt tmp;
|
||||
if (Tcl_GetWideIntFromObj(NULL,$input,&tmp) == TCL_ERROR) $1 = 0;
|
||||
else $1 = 1;
|
||||
long long, const long long &
|
||||
{
|
||||
int len;
|
||||
char *end = 0;
|
||||
char *str = Tcl_GetStringFromObj($input, &len);
|
||||
strtoll(str, &end, 0);
|
||||
$1 = (end != 0) && (*end != '\0') && (str != end) && (errno == 0);
|
||||
}
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_INTEGER)
|
||||
unsigned long long, const unsigned long long &
|
||||
{
|
||||
int len;
|
||||
char *end = 0;
|
||||
char *str = Tcl_GetStringFromObj($input, &len);
|
||||
strtoull(str, &end, 0);
|
||||
$1 = (end != 0) && (*end != '\0') && (str != end) && (errno == 0);
|
||||
}
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_DOUBLE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue