fix long long handling - mainly patch 1771313. Attempt to define ISO limits that should be in limits.h if gcc has not defined them. This might need refining further.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9954 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
f8142058e1
commit
ed3938e36f
2 changed files with 24 additions and 12 deletions
|
|
@ -319,16 +319,16 @@
|
|||
* common fragments
|
||||
* ------------------------------------------------------------ */
|
||||
|
||||
/* Default compiler options for gcc allow long_long but not LLONG_MAX.
|
||||
* Define SWIG_NO_LLONG_MAX if this added limits support is not wanted. */
|
||||
%fragment("<limits.h>","header") %{
|
||||
#include <limits.h>
|
||||
#ifndef LLONG_MIN
|
||||
# define LLONG_MIN LONG_LONG_MIN
|
||||
#endif
|
||||
#ifndef LLONG_MAX
|
||||
# define LLONG_MAX LONG_LONG_MAX
|
||||
#endif
|
||||
#ifndef ULLONG_MAX
|
||||
# define ULLONG_MAX ULONG_LONG_MAX
|
||||
#if !defined(SWIG_NO_LLONG_MAX)
|
||||
# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
|
||||
# define LLONG_MAX __LONG_LONG_MAX__
|
||||
# define LLONG_MIN (-LLONG_MAX - 1LL)
|
||||
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
|
||||
# endif
|
||||
#endif
|
||||
%}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue