gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r11751: jpeglib.h is already extern'


From: Rob Savoye
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11751: jpeglib.h is already extern'd. Use typedef for jpeg::boolean so it builds on Cygwin.
Date: Thu, 14 Jan 2010 16:33:20 -0700
User-agent: Bazaar (2.0.2)

------------------------------------------------------------
revno: 11751
committer: Rob Savoye <address@hidden>
branch nick: trunk
timestamp: Thu 2010-01-14 16:33:20 -0700
message:
  jpeglib.h is already extern'd. Use typedef for jpeg::boolean so it builds on 
Cygwin.
modified:
  libbase/GnashImageJpeg.cpp
  libbase/GnashImageJpeg.h
=== modified file 'libbase/GnashImageJpeg.cpp'
--- a/libbase/GnashImageJpeg.cpp        2010-01-01 17:48:26 +0000
+++ b/libbase/GnashImageJpeg.cpp        2010-01-14 23:33:20 +0000
@@ -36,21 +36,39 @@
 #include <sstream>
 #include <csetjmp>
 
+/// \brief A namespace solely for avoiding name 
+/// conflicts with other external headers.
+namespace jpeg {
+
+// jpeglib.h redefines HAVE_STDLIB_H. This silences
+// the warnings, but it's not good.
+#undef HAVE_STDLIB_H
+#include <jpeglib.h>
+#undef HAVE_STDLIB_H
+
+}
+
 // jpeglib.h is included in the namespace jpeg because otherwise it
 // causes horrible conflicts with qt includes. How do C coders sustain
 // the will to live?
 using namespace jpeg;
 
+#ifdef _WIN32
+typedef jpeg_boolean jpeg_bool_t;
+#else
+typedef jpeg::boolean jpeg_bool_t;
+#endif
 
 namespace gnash
 {
 
-static void    jpeg_error_exit(j_common_ptr cinfo)
+static void
+jpeg_error_exit(j_common_ptr cinfo)
 {
 
        // Set a flag to stop parsing 
        JpegImageInput* in = static_cast<JpegImageInput*>(cinfo->client_data);
-
+       
        
in->errorOccurred(cinfo->err->jpeg_message_table[cinfo->err->msg_code]); 
 
        //log_error("failing to abort jpeg parser here (would need a long-jump 
call)");
@@ -58,7 +76,8 @@
 
 
 // Set up some error handlers for the jpeg lib.
-static void    setup_jpeg_err(jpeg_error_mgr* jerr)
+static void
+setup_jpeg_err(jpeg_error_mgr* jerr)
 {
        // Set up defaults.
        jpeg_std_error(jerr);
@@ -67,7 +86,7 @@
 }
 
 // Helper object for reading jpeg image data.  Basically a thin
-static const int       IO_BUF_SIZE = 4096;
+static const int IO_BUF_SIZE = 4096;
 
 // A jpeglib source manager that reads from a IOChannel.  Paraphrased
 // from IJG jpeglib jdatasrc.c.
@@ -98,7 +117,7 @@
 
        // Read data into our input buffer.  Client calls this
        // when it needs more data from the file.
-       static jpeg::boolean fill_input_buffer(j_decompress_ptr cinfo)
+       static jpeg_bool_t fill_input_buffer(j_decompress_ptr cinfo)
        {
                rw_source_IOChannel*    src = (rw_source_IOChannel*) cinfo->src;
 
@@ -508,7 +527,7 @@
        }
 
        /// Write the output buffer into the stream.
-       static jpeg::boolean empty_output_buffer(j_compress_ptr cinfo)
+       static jpeg_bool_t empty_output_buffer(j_compress_ptr cinfo)
        {
                rw_dest_IOChannel*      dest = (rw_dest_IOChannel*) cinfo->dest;
                assert(dest);

=== modified file 'libbase/GnashImageJpeg.h'
--- a/libbase/GnashImageJpeg.h  2010-01-01 17:48:26 +0000
+++ b/libbase/GnashImageJpeg.h  2010-01-14 23:33:20 +0000
@@ -32,13 +32,11 @@
 /// conflicts with other external headers.
 namespace jpeg {
 
-extern "C" {
 // jpeglib.h redefines HAVE_STDLIB_H. This silences
 // the warnings, but it's not good.
 #undef HAVE_STDLIB_H
 #include <jpeglib.h>
 #undef HAVE_STDLIB_H
-}
 
 }
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]