Skip to content
Permalink
Browse files

Patched PyCXX 6.2.5 with original FreeCAD changes made in 6.2.0

  • Loading branch information...
yorikvanhavre committed Sep 18, 2014
1 parent 69c4b37 commit f87bd2ac352dee9ea9aa27096141e0a37326fa45

Large diffs are not rendered by default.

@@ -114,5 +114,19 @@
#if PY_MAJOR_VERSION < 2 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 5)
typedef int Py_ssize_t;
#endif

// export macro
#if defined( _MSC_VER )
# pragma warning( disable : 4251 )
#endif
#if defined( _MSC_VER ) || defined( __MINGW32__ )
# ifdef PYCXX_DLL
# define PYCXX_EXPORT __declspec(dllexport)
# else
# define PYCXX_EXPORT __declspec(dllimport)
# endif
#else
# define PYCXX_EXPORT
#endif

#endif // __PyCXX_config_hh__
@@ -53,7 +53,7 @@ namespace Py

class Object;

class Exception
class PYCXX_EXPORT Exception
{
public:
Exception( ExtensionExceptionType &exception, const std::string& reason );
@@ -83,28 +83,28 @@ namespace Py


// Abstract
class StandardError: public Exception
class PYCXX_EXPORT StandardError: public Exception
{
protected:
explicit StandardError()
{}
};

class LookupError: public StandardError
class PYCXX_EXPORT LookupError: public StandardError
{
protected:
explicit LookupError()
{}
};

class ArithmeticError: public StandardError
class PYCXX_EXPORT ArithmeticError: public StandardError
{
protected:
explicit ArithmeticError()
{}
};

class EnvironmentError: public StandardError
class PYCXX_EXPORT EnvironmentError: public StandardError
{
protected:
explicit EnvironmentError()
@@ -113,7 +113,7 @@ namespace Py

// Concrete

class TypeError: public StandardError
class PYCXX_EXPORT TypeError: public StandardError
{
public:
TypeError (const std::string& reason)
@@ -123,7 +123,7 @@ namespace Py
}
};

class IndexError: public LookupError
class PYCXX_EXPORT IndexError: public LookupError
{
public:
IndexError (const std::string& reason)
@@ -133,7 +133,7 @@ namespace Py
}
};

class AttributeError: public StandardError
class PYCXX_EXPORT AttributeError: public StandardError
{
public:
AttributeError (const std::string& reason)
@@ -143,7 +143,7 @@ namespace Py
}
};

class NameError: public StandardError
class PYCXX_EXPORT NameError: public StandardError
{
public:
NameError (const std::string& reason)
@@ -153,7 +153,7 @@ namespace Py
}
};

class RuntimeError: public StandardError
class PYCXX_EXPORT RuntimeError: public StandardError
{
public:
RuntimeError (const std::string& reason)
@@ -173,7 +173,7 @@ namespace Py
}
};

class SystemError: public StandardError
class PYCXX_EXPORT SystemError: public StandardError
{
public:
SystemError (const std::string& reason)
@@ -183,7 +183,7 @@ namespace Py
}
};

class KeyError: public LookupError
class PYCXX_EXPORT KeyError: public LookupError
{
public:
KeyError (const std::string& reason)
@@ -194,7 +194,7 @@ namespace Py
};


class ValueError: public StandardError
class PYCXX_EXPORT ValueError: public StandardError
{
public:
ValueError (const std::string& reason)
@@ -204,7 +204,7 @@ namespace Py
}
};

class OverflowError: public ArithmeticError
class PYCXX_EXPORT OverflowError: public ArithmeticError
{
public:
OverflowError (const std::string& reason)
@@ -214,7 +214,7 @@ namespace Py
}
};

class ZeroDivisionError: public ArithmeticError
class PYCXX_EXPORT ZeroDivisionError: public ArithmeticError
{
public:
ZeroDivisionError (const std::string& reason)
@@ -224,7 +224,7 @@ namespace Py
}
};

class FloatingPointError: public ArithmeticError
class PYCXX_EXPORT FloatingPointError: public ArithmeticError
{
public:
FloatingPointError (const std::string& reason)
@@ -234,7 +234,7 @@ namespace Py
}
};

class MemoryError: public StandardError
class PYCXX_EXPORT MemoryError: public StandardError
{
public:
MemoryError (const std::string& reason)
@@ -244,7 +244,7 @@ namespace Py
}
};

class SystemExit: public StandardError
class PYCXX_EXPORT SystemExit: public StandardError
{
public:
SystemExit (const std::string& reason)
@@ -40,7 +40,7 @@

namespace Py
{
class ExtensionModuleBase
class PYCXX_EXPORT ExtensionModuleBase
{
public:
ExtensionModuleBase( const char *name );
@@ -77,11 +77,11 @@ namespace Py
};

// Note: Python calls noargs as varargs buts args==NULL
extern "C" PyObject *method_noargs_call_handler( PyObject *_self_and_name_tuple, PyObject * );
extern "C" PyObject *method_varargs_call_handler( PyObject *_self_and_name_tuple, PyObject *_args );
extern "C" PyObject *method_keyword_call_handler( PyObject *_self_and_name_tuple, PyObject *_args, PyObject *_keywords );
extern "C" PYCXX_EXPORT PyObject *method_noargs_call_handler( PyObject *_self_and_name_tuple, PyObject * );
extern "C" PYCXX_EXPORT PyObject *method_varargs_call_handler( PyObject *_self_and_name_tuple, PyObject *_args );
extern "C" PYCXX_EXPORT PyObject *method_keyword_call_handler( PyObject *_self_and_name_tuple, PyObject *_args, PyObject *_keywords );

extern "C" void do_not_dealloc( void * );
extern "C" PYCXX_EXPORT void do_not_dealloc( void * );

template<TEMPLATE_TYPENAME T>
class ExtensionModule : public ExtensionModuleBase
@@ -113,7 +113,7 @@ namespace Py
};


class ExtensionClassMethodsTable
class PYCXX_EXPORT ExtensionClassMethodsTable
{
public:
ExtensionClassMethodsTable()
@@ -59,7 +59,7 @@ namespace Py

// This special deallocator does a delete on the pointer.

class PythonExtensionBase : public PyObject
class PYCXX_EXPORT PythonExtensionBase : public PyObject
{
public:
PythonExtensionBase();
@@ -63,7 +63,7 @@ namespace Py
class ExtensionModuleBase;

// Make an Exception Type for use in raising custom exceptions
class ExtensionExceptionType : public Object
class PYCXX_EXPORT ExtensionExceptionType : public Object
{
public:
ExtensionExceptionType();
@@ -74,7 +74,7 @@ namespace Py
void init( ExtensionModuleBase &module, const std::string &name );
};

class MethodTable
class PYCXX_EXPORT MethodTable
{
public:
MethodTable();

0 comments on commit f87bd2a

Please sign in to comment.
You can’t perform that action at this time.