diff --git a/Code/JavaWrappers/csharp_wrapper/CMakeLists.txt b/Code/JavaWrappers/csharp_wrapper/CMakeLists.txt index bcb49d50d..90e13ff10 100644 --- a/Code/JavaWrappers/csharp_wrapper/CMakeLists.txt +++ b/Code/JavaWrappers/csharp_wrapper/CMakeLists.txt @@ -2,7 +2,6 @@ project (GraphMolCSharp) include_directories( ${RDKit_ExternalDir} ) - # find the gmcs executables on non-windows systems: if(NOT WIN32) find_program(GMCS_EXE gmcs) @@ -65,7 +64,7 @@ SWIG_ADD_MODULE(RDKFuncs "CSharp" GraphMolCSharp.i ) SWIG_LINK_LIBRARIES(RDKFuncs ${RDKit_Wrapper_Libs} ${RDKit_THREAD_LIBS} ) -INSTALL(TARGETS RDKFuncs +INSTALL(TARGETS RDKFuncs DESTINATION ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/Code/JavaWrappers/csharp_wrapper/GraphMolCSharp.i b/Code/JavaWrappers/csharp_wrapper/GraphMolCSharp.i index a918d3224..3e314058d 100644 --- a/Code/JavaWrappers/csharp_wrapper/GraphMolCSharp.i +++ b/Code/JavaWrappers/csharp_wrapper/GraphMolCSharp.i @@ -1,21 +1,22 @@ -/* + +/* * $Id: GraphMolJava.i 2141 2012-07-27 06:16:45Z glandrum $ * * Copyright (c) 2010, Novartis Institutes for BioMedical Research Inc. * All rights reserved. -* +* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are -* met: +* met: * -* * Redistributions of source code must retain the above copyright +* * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above -* copyright notice, this list of conditions and the following -* disclaimer in the documentation and/or other materials provided +* copyright notice, this list of conditions and the following +* disclaimer in the documentation and/or other materials provided * with the distribution. -* * Neither the name of Novartis Institutes for BioMedical Research Inc. -* nor the names of its contributors may be used to endorse or promote +* * Neither the name of Novartis Institutes for BioMedical Research Inc. +* nor the names of its contributors may be used to endorse or promote * products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS @@ -32,6 +33,25 @@ */ %module RDKFuncs +#if defined(SWIGWORDSIZE64) +%{ +// There's a problem with SWIG, 64bit windows, and modern VC++ versions +// This fine, fine piece of code fixes that. +// it's ok to think this is horrible, we won't mind +#ifdef _MSC_VER + +#ifndef LONG_MAX +#include +#endif + +#if LONG_MAX==INT_MAX +#define LONG_MAX (INT_MAX+1) +#endif + +#endif +%} +#endif + /* Suppress the unimportant warnings */ #pragma SWIG nowarn=503,516 @@ -41,10 +61,17 @@ #include %} // The actual definition isn't in the top level hpp file! +#define BOOST_NOEXCEPT +#define BOOST_NO_CXX11_RVALUE_REFERENCES +#define BOOST_NO_CXX11_NULLPTR %include /* Include the base types before anything that will utilize them */ -%include "stdint.i" +#ifdef SWIGWIN +%include "../msvc_stdint.i" +#else +%include "../stdint.i" +#endif %include "std_string.i" %include "std_list.i" %include "extend_std_vector.i" diff --git a/Code/JavaWrappers/gmwrapper/GraphMolJava.i b/Code/JavaWrappers/gmwrapper/GraphMolJava.i index aab8abecd..434d46ef4 100644 --- a/Code/JavaWrappers/gmwrapper/GraphMolJava.i +++ b/Code/JavaWrappers/gmwrapper/GraphMolJava.i @@ -1,21 +1,21 @@ -/* +/* * $Id$ * * Copyright (c) 2010, Novartis Institutes for BioMedical Research Inc. * All rights reserved. -* +* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are -* met: +* met: * -* * Redistributions of source code must retain the above copyright +* * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above -* copyright notice, this list of conditions and the following -* disclaimer in the documentation and/or other materials provided +* copyright notice, this list of conditions and the following +* disclaimer in the documentation and/or other materials provided * with the distribution. -* * Neither the name of Novartis Institutes for BioMedical Research Inc. -* nor the names of its contributors may be used to endorse or promote +* * Neither the name of Novartis Institutes for BioMedical Research Inc. +* nor the names of its contributors may be used to endorse or promote * products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS @@ -32,6 +32,25 @@ */ %module RDKFuncs +#if defined(SWIGWORDSIZE64) +%{ +// There's a problem with SWIG, 64bit windows, and modern VC++ versions +// This fine, fine piece of code fixes that. +// it's ok to think this is horrible, we won't mind +#ifdef _MSC_VER + +#ifndef LONG_MAX +#include +#endif + +#if LONG_MAX==INT_MAX +#define LONG_MAX (INT_MAX+1) +#endif + +#endif +%} +#endif + /* Suppress the unimportant warnings */ #pragma SWIG nowarn=503,516 @@ -49,7 +68,11 @@ %include /* Include the base types before anything that will utilize them */ -%include "stdint.i" +#ifdef SWIGWIN +%include "../msvc_stdint.i" +#else +%include "../stdint.i" +#endif %include "std_string.i" %include "std_list.i" %include "extend_std_vector.i" diff --git a/Code/JavaWrappers/msvc_stdint.i b/Code/JavaWrappers/msvc_stdint.i new file mode 100644 index 000000000..5f2c64f10 --- /dev/null +++ b/Code/JavaWrappers/msvc_stdint.i @@ -0,0 +1,104 @@ +/* ----------------------------------------------------------------------------- + * stdint.i + * + * SWIG library file for ISO C99 types: 7.18 Integer types + * ----------------------------------------------------------------------------- */ + +%{ +#include // Use the C99 official header +%} + +%include + +/* Exact integral types. */ + +/* Signed. */ + +typedef signed char int8_t; +typedef short int int16_t; +typedef int int32_t; +#if defined(SWIGWORDSIZE64) +typedef long int int32_t; +#else +typedef long long int int64_t; +#endif + +/* Unsigned. */ +typedef unsigned char uint8_t; +typedef unsigned short int uint16_t; +typedef unsigned int uint32_t; +#if defined(SWIGWORDSIZE64) +typedef unsigned long int uint32_t; +#else +typedef unsigned long long int uint64_t; +#endif + + +/* Small types. */ + +/* Signed. */ +typedef signed char int_least8_t; +typedef short int int_least16_t; +typedef int int_least32_t; +#if defined(SWIGWORDSIZE64) +typedef long int int_least32_t; +#else +typedef long long int int_least64_t; +#endif + +/* Unsigned. */ +typedef unsigned char uint_least8_t; +typedef unsigned short int uint_least16_t; +typedef unsigned int uint_least32_t; +#if defined(SWIGWORDSIZE64) +typedef unsigned long int uint_least32_t; +#else +typedef unsigned long long int uint_least64_t; +#endif + + +/* Fast types. */ + +/* Signed. */ +typedef signed char int_fast8_t; +#if defined(SWIGWORDSIZE64) +typedef long int int_fast16_t; +typedef long int int_fast32_t; +#else +typedef int int_fast16_t; +typedef int int_fast32_t; +typedef long long int int_fast64_t; +#endif + +/* Unsigned. */ +typedef unsigned char uint_fast8_t; +#if defined(SWIGWORDSIZE64) +typedef unsigned long int uint_fast16_t; +typedef unsigned long int uint_fast32_t; +#else +typedef unsigned int uint_fast16_t; +typedef unsigned int uint_fast32_t; +typedef unsigned long long int uint_fast64_t; +#endif + + +/* Types for `void *' pointers. */ +#if defined(SWIGWORDSIZE64) +typedef long int intptr_t; +typedef unsigned long int uintptr_t; +#else +typedef int intptr_t; +typedef unsigned int uintptr_t; +#endif + + +/* Largest integral types. */ +#if defined(SWIGWORDSIZE64) +typedef long int intmax_t; +typedef unsigned long int uintmax_t; +#else +typedef long long int intmax_t; +typedef unsigned long long int uintmax_t; +#endif + +