Fix compilation with Visual Studio

This commit is contained in:
Kovid Goyal 2016-05-06 07:36:24 +05:30
parent 404153b591
commit 59da7ed5be
2 changed files with 8 additions and 7 deletions

View File

@ -5,8 +5,9 @@
* Distributed under terms of the GPL3 license.
*/
#include "imageops.h"
#include <stdexcept>
#include "imageops.h"
#include <QColor>
#define SQUARE(x) (x)*(x)
#define MAX(x, y) ((x) > (y)) ? (x) : (y)

View File

@ -7,10 +7,10 @@
%Import QtGui/QtGuimod.sip
%ModuleCode
#include <imageops.h>
#define PREFIX \
#define IMAGEOPS_PREFIX \
QImage ans; \
try {
#define SUFFIX \
#define IMAGEOPS_SUFFIX \
if (PyErr_Occurred()) return NULL; \
sipRes = new (std::nothrow) QImage(ans); \
if (sipRes == NULL) return PyErr_NoMemory(); \
@ -22,14 +22,14 @@
QImage* remove_borders(const QImage &image, double fuzz);
%MethodCode
PREFIX
IMAGEOPS_PREFIX
ans = remove_borders(*a0, a1);
SUFFIX
IMAGEOPS_SUFFIX
%End
QImage* grayscale(const QImage &image);
%MethodCode
PREFIX
IMAGEOPS_PREFIX
ans = grayscale(*a0);
SUFFIX
IMAGEOPS_SUFFIX
%End