diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2015-01-15 22:15:29 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2015-01-17 06:31:20 +0100 |
commit | 9d46189a64769d44842accfe427ebf5cdbc9d73b (patch) | |
tree | 47e09e6cac6dc4a7432941a1cf7e2ab3a7265e8b /src/gui/image/qpnghandler.cpp | |
parent | 2f010390adba67996de687dd8d3bc427fb2305bf (diff) |
Remove Q_C_CALLBACKS
This is useless. The C++ language does require callbacks passed to C
functions to also be extern "C". That's what this macro was doing.
But #ifdef'ing for the macro only made the code uglier. Just let the
extern "C" be there for all compilers.
PS: C++ classes can't be extern "C"...
Change-Id: Ic5d393bfd36e48a193fcffff13b9c9b3923443dd
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/gui/image/qpnghandler.cpp')
-rw-r--r-- | src/gui/image/qpnghandler.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp index d09ed0fda7..c19bc52a97 100644 --- a/src/gui/image/qpnghandler.cpp +++ b/src/gui/image/qpnghandler.cpp @@ -157,10 +157,6 @@ public: }; -#if defined(Q_C_CALLBACKS) -extern "C" { -#endif - class QPNGImageWriter { public: explicit QPNGImageWriter(QIODevice*); @@ -190,6 +186,7 @@ private: float gamma; }; +extern "C" { static void CALLBACK_CALL_TYPE iod_read_fn(png_structp png_ptr, png_bytep data, png_size_t length) { @@ -234,9 +231,7 @@ void CALLBACK_CALL_TYPE qpiw_flush_fn(png_structp /* png_ptr */) { } -#if defined(Q_C_CALLBACKS) } -#endif static void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scaledSize, bool *doScaledRead, float screen_gamma=0.0) @@ -492,17 +487,13 @@ static void read_image_scaled(QImage *outImage, png_structp png_ptr, png_infop i } -#if defined(Q_C_CALLBACKS) extern "C" { -#endif static void CALLBACK_CALL_TYPE qt_png_warning(png_structp /*png_ptr*/, png_const_charp message) { qWarning("libpng warning: %s", message); } -#if defined(Q_C_CALLBACKS) } -#endif void Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngTexts(png_info *info) |