[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r10826: Add two more compatibility h
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r10826: Add two more compatibility headers for Net (ntohs etc) and FD (select) |
Date: |
Thu, 23 Apr 2009 16:46:54 +0200 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 10826
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Thu 2009-04-23 16:46:54 +0200
message:
Add two more compatibility headers for Net (ntohs etc) and FD (select)
system functions. Use them in libcore, libamf, libbase and utility to
replace ifdef code there.
added:
libbase/GnashSystemFDHeaders.h
libbase/GnashSystemNetHeaders.h
modified:
libamf/amf.cpp
libamf/amf_msg.cpp
libamf/flv.cpp
libamf/sol.cpp
libbase/GnashFileUtilities.h
libbase/Makefile.am
libbase/curl_adapter.cpp
libcore/URLAccessManager.cpp
libcore/asobj/Date_as.cpp
libcore/asobj/NetConnection_as.cpp
libcore/asobj/NetStream_as.cpp
libcore/asobj/SharedObject_as.cpp
libcore/asobj/XMLSocket_as.cpp
utilities/flvdumper.cpp
utilities/processor.cpp
utilities/soldumper.cpp
=== modified file 'libamf/amf.cpp'
--- a/libamf/amf.cpp 2009-02-25 22:33:03 +0000
+++ b/libamf/amf.cpp 2009-04-23 14:46:54 +0000
@@ -21,26 +21,18 @@
#include "gnashconfig.h"
#endif
-#include <boost/shared_ptr.hpp>
-#include <string>
-#include <vector>
-
+#include "GnashSystemNetHeaders.h"
#include "log.h"
#include "GnashException.h"
#include "buffer.h"
#include "amf.h"
-//#include "network.h"
#include "element.h"
#include "amfutf8.h"
-#include <boost/cstdint.hpp> // for boost::?int??_t
-#if !defined(HAVE_WINSOCK_H) || defined(__OS2__)
-# include <sys/types.h>
-# include <arpa/inet.h>
-#else
-# include <windows.h>
-# include <io.h>
-#endif
+#include <boost/shared_ptr.hpp>
+#include <string>
+#include <vector>
+#include <boost/cstdint.hpp>
using namespace std;
using namespace gnash;
=== modified file 'libamf/amf_msg.cpp'
--- a/libamf/amf_msg.cpp 2009-04-20 19:58:32 +0000
+++ b/libamf/amf_msg.cpp 2009-04-23 14:46:54 +0000
@@ -24,14 +24,12 @@
#include "amf_msg.h"
#include "element.h"
#include "network.h"
+#include "GnashSystemNetHeaders.h"
#include <boost/shared_ptr.hpp>
#include <string>
#include <boost/cstdint.hpp> // For C99 int types
-#if !defined(HAVE_WINSOCK_H) || defined(__OS2__)
-#include <arpa/inet.h> // for htons
-#endif
using namespace std;
using namespace gnash;
=== modified file 'libamf/flv.cpp'
--- a/libamf/flv.cpp 2009-02-25 22:33:03 +0000
+++ b/libamf/flv.cpp 2009-04-23 14:46:54 +0000
@@ -21,30 +21,21 @@
#include "gnashconfig.h"
#endif
+#include "GnashSystemNetHeaders.h"
+#include "buffer.h"
+#include "log.h"
+#include "amf.h"
+#include "amfutf8.h"
+#include "utility.h"
+#include "flv.h"
+
#include <boost/detail/endian.hpp>
#include <boost/shared_ptr.hpp>
#include <string>
#include <vector>
#include <cmath>
#include <climits>
-#if !defined(HAVE_WINSOCK_H) || defined(__OS2__)
-# include <sys/types.h>
-# include <arpa/inet.h>
-#else
-# include <windows.h>
-# include <io.h>
-#endif
-
-#include "buffer.h"
-#include "log.h"
-#include "amf.h"
-#include "amfutf8.h"
-#include "utility.h"
-#include "flv.h"
-
-//#include <boost/detail/endian.hpp>
-
-#include <boost/cstdint.hpp> // for boost::?int??_t
+#include <boost/cstdint.hpp>
using namespace std;
using namespace gnash;
=== modified file 'libamf/sol.cpp'
--- a/libamf/sol.cpp 2009-02-25 22:33:03 +0000
+++ b/libamf/sol.cpp 2009-04-23 14:46:54 +0000
@@ -19,36 +19,25 @@
#include "gnashconfig.h"
#endif
+#include "GnashSystemNetHeaders.h"
+#include "GnashFileUtilities.h"
+#include "element.h"
+#include "amf.h"
+#include "buffer.h"
+#include "sol.h"
+#include "log.h"
+#include "GnashException.h"
+
+#include <boost/scoped_array.hpp>
#include <boost/cstdint.hpp>
#include <boost/shared_ptr.hpp>
#include <cerrno>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <string>
#include <vector>
#include <iostream>
#include <fstream>
#include <cassert>
-//#include "network.h"
-#include "element.h"
-#include "amf.h"
-#include "buffer.h"
-#include "sol.h"
-#include "log.h"
-#include "GnashException.h"
-
-#if defined(HAVE_WINSOCK_H) && !defined(__OS2__)
-# include <winsock2.h>
-# include <windows.h>
-# include <sys/stat.h>
-# include <io.h>
-# include <ws2tcpip.h>
-#else
-#include <arpa/inet.h>
-#endif
-
-#include <boost/scoped_array.hpp>
using namespace std;
using namespace amf;
=== modified file 'libbase/GnashFileUtilities.h'
--- a/libbase/GnashFileUtilities.h 2009-01-29 15:08:14 +0000
+++ b/libbase/GnashFileUtilities.h 2009-04-23 14:46:54 +0000
@@ -23,6 +23,7 @@
/// fstat()
/// lstat()
/// dup()
+/// readdir()
#ifndef GNASH_FILE_UTILITIES_H
#define GNASH_FILE_UTILITIES_H
@@ -33,6 +34,7 @@
# include <unistd.h>
# include <sys/stat.h>
# include <sys/types.h>
+# include <dirent.h>
#else
#include <io.h>
#define dup _dup
=== added file 'libbase/GnashSystemFDHeaders.h'
--- a/libbase/GnashSystemFDHeaders.h 1970-01-01 00:00:00 +0000
+++ b/libbase/GnashSystemFDHeaders.h 2009-04-23 14:46:54 +0000
@@ -0,0 +1,36 @@
+// GnashSystemFDHeaders.h: Compatibility FD header for Gnash.
+//
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+//
+
+// Include this file for file descriptor utilities:
+//
+// select()
+
+#ifndef GNASH_SYSTEM_FD_HEADERS
+#define GNASH_SYSTEM_FD_HEADERS
+
+#ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+#else
+# include <sys/types.h>
+# include <sys/stat.h>
+# include <unistd.h>
+#endif
+
+#endif
=== added file 'libbase/GnashSystemNetHeaders.h'
--- a/libbase/GnashSystemNetHeaders.h 1970-01-01 00:00:00 +0000
+++ b/libbase/GnashSystemNetHeaders.h 2009-04-23 14:46:54 +0000
@@ -0,0 +1,41 @@
+// GnashImageSystemNetHeaders.h: Compatibility Network header for Gnash.
+//
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+//
+
+/// This file should be included for:
+//
+/// htons()
+/// ntohs()
+
+#ifndef GNASH_NET_HEADERS_H
+#define GNASH_NET_HEADERS_H
+
+/// @todo A configure 'test' (a #define in gnashconfig.h) might be a better
+/// way of checking for compiler.
+#if defined(HAVE_WINSOCK_H) && !defined(__OS2__)
+# include <winsock2.h>
+# include <windows.h>
+# include <io.h>
+# include <ws2tcpip.h>
+#else
+# include <arpa/inet.h>
+#endif
+
+#endif
+
=== modified file 'libbase/Makefile.am'
--- a/libbase/Makefile.am 2009-03-19 18:38:22 +0000
+++ b/libbase/Makefile.am 2009-04-23 14:46:54 +0000
@@ -157,6 +157,7 @@
tu_file.h \
IOChannel.h \
tu_opengl_includes.h \
+ GnashSystemNetHeaders.h \
GnashSystemIOHeaders.h \
GnashFileUtilities.h \
NamingPolicy.h \
=== modified file 'libbase/curl_adapter.cpp'
--- a/libbase/curl_adapter.cpp 2009-03-29 19:26:31 +0000
+++ b/libbase/curl_adapter.cpp 2009-04-23 14:46:54 +0000
@@ -74,6 +74,7 @@
#include "utility.h"
#include "GnashException.h"
#include "rc.h"
+#include "GnashSystemFDHeaders.h"
#include <map>
#include <string>
@@ -82,15 +83,6 @@
#include <cstdio> // cached data uses a *FILE
#include <cstdlib> // std::getenv
-// For select()
-#ifdef HAVE_WINSOCK2_H
-# include <winsock2.h>
-#else
-# include <sys/types.h>
-# include <sys/stat.h>
-# include <unistd.h>
-#endif
-
//#define GNASH_CURL_VERBOSE 1
// define this if you want seeks back to be reported
=== modified file 'libcore/URLAccessManager.cpp'
--- a/libcore/URLAccessManager.cpp 2009-02-25 22:33:03 +0000
+++ b/libcore/URLAccessManager.cpp 2009-04-23 14:46:54 +0000
@@ -22,23 +22,14 @@
#include "URLAccessManager.h"
#include "URL.h"
#include "log.h"
-#include "StringPredicates.h" // for case-insensitive host match
-#include "VM.h" // for getRoot().getRootMovie()
-
+#include "StringPredicates.h"
+#include "VM.h"
#include "rc.h" // for rcfile
-#include <cerrno> // for errno :)
+#include "GnashSystemIOHeaders.h"
-// temporary use of console for confirm load of network urls
-#include <iconv.h>
+#include <cerrno>
#include <iostream>
#include <algorithm> // for find / find_if
-
-#ifdef WIN32
-# include <winsock2.h>
-#else
-# include "GnashSystemIOHeaders.h"
-#endif
-
#include <cstring> // for strerror
#include <cstdio>
#include <map>
=== modified file 'libcore/asobj/Date_as.cpp'
--- a/libcore/asobj/Date_as.cpp 2009-03-17 11:39:48 +0000
+++ b/libcore/asobj/Date_as.cpp 2009-04-23 14:46:54 +0000
@@ -24,7 +24,7 @@
// Flash player handles a huge range of dates, including
// thousands of years BC. The timestamp value is correspondingly
// large: it is a double, which has a minimum size of 8 bytes
-// in the C++ standard. Methods provided by ctime and sys/time.h
+// in the C++ standard. Methods provided by <ctime>
// generally rely on time_t whose size varies according to platform.
// It is not big enough to deal with all valid SWF timestamps,
// so this class uses its own methods to convert to and from
=== modified file 'libcore/asobj/NetConnection_as.cpp'
--- a/libcore/asobj/NetConnection_as.cpp 2009-04-13 10:28:31 +0000
+++ b/libcore/asobj/NetConnection_as.cpp 2009-04-23 14:46:54 +0000
@@ -22,17 +22,7 @@
#include "gnashconfig.h"
#endif
-#include <iostream>
-#include <string>
-#include <boost/scoped_ptr.hpp>
-
-// FIXME: Get rid of this crap.
-#if defined(HAVE_WINSOCK_H) && !defined(__OS2__)
-# include <winsock.h>
-#else
-#include <arpa/inet.h> // for htons
-#endif
-
+#include "GnashSystemNetHeaders.h"
#include "NetConnection_as.h"
#include "log.h"
#include "GnashException.h"
@@ -48,6 +38,10 @@
#include "namedStrings.h"
#include "GnashAlgorithm.h"
+#include <iostream>
+#include <string>
+#include <boost/scoped_ptr.hpp>
+
//#define GNASH_DEBUG_REMOTING
// Forward declarations.
=== modified file 'libcore/asobj/NetStream_as.cpp'
--- a/libcore/asobj/NetStream_as.cpp 2009-04-03 09:18:40 +0000
+++ b/libcore/asobj/NetStream_as.cpp 2009-04-23 14:46:54 +0000
@@ -24,10 +24,8 @@
#include "NetStream_as.h"
#include "CharacterProxy.h"
-
#include "smart_ptr.h" // GNASH_USE_GC
#include "log.h"
-
#include "fn_call.h"
#include "builtin_function.h"
#include "GnashException.h"
@@ -38,20 +36,10 @@
#include "movie_root.h"
#include "GnashAlgorithm.h"
#include "VirtualClock.h" // for PlayHead
-
#include "MediaHandler.h"
#include "StreamProvider.h"
#include "sound_handler.h"
-
-// For ntohs in amf conversion. FIXME: do this somewhere
-// more appropriate. There's AMF code scattered all over the place.
-#if !defined(HAVE_WINSOCK_H) || defined(__OS2__)
-# include <sys/types.h>
-# include <arpa/inet.h>
-#else
-# include <windows.h>
-# include <io.h>
-#endif
+#include "GnashSystemNetHeaders.h"
// Define the following macro to have status notification handling debugged
//#define GNASH_DEBUG_STATUS
=== modified file 'libcore/asobj/SharedObject_as.cpp'
--- a/libcore/asobj/SharedObject_as.cpp 2009-04-03 09:18:40 +0000
+++ b/libcore/asobj/SharedObject_as.cpp 2009-04-23 14:46:54 +0000
@@ -21,17 +21,7 @@
#include "gnashconfig.h" // USE_SOL_READ_ONLY
#endif
-#include <boost/tokenizer.hpp>
-#include <boost/scoped_array.hpp>
-#include <boost/shared_ptr.hpp>
-#if !defined(HAVE_WINSOCK_H) || defined(__OS2__)
-# include <sys/types.h>
-# include <arpa/inet.h>
-#else
-# include <windows.h>
-# include <io.h>
-#endif
-
+#include "GnashSystemNetHeaders.h"
#include "GnashFileUtilities.h" // stat
#include "SimpleBuffer.h"
#include "as_value.h"
@@ -52,6 +42,10 @@
#include "URL.h"
#include "rc.h" // for use of rcfile
+#include <boost/tokenizer.hpp>
+#include <boost/scoped_array.hpp>
+#include <boost/shared_ptr.hpp>
+
// Undefine this to use the Element-based AMF0 decoder/encoder.
// May be useful to test libamf.
#define BUFFERED_AMF_SOL
=== modified file 'libcore/asobj/XMLSocket_as.cpp'
--- a/libcore/asobj/XMLSocket_as.cpp 2009-03-17 09:44:00 +0000
+++ b/libcore/asobj/XMLSocket_as.cpp 2009-04-23 14:46:54 +0000
@@ -21,8 +21,7 @@
#include "gnashconfig.h"
#endif
-#include "GnashSystemIOHeaders.h" // read
-
+#include "GnashSystemFDHeaders.h"
#include "network.h"
#include "utility.h"
#include "XML_as.h"
@@ -33,17 +32,7 @@
#include "builtin_function.h" // for setting timer, should likely avoid that..
#include "URLAccessManager.h"
#include "Object.h" // for getObjectInterface
-
#include "log.h"
-
-// For select()
-#ifdef HAVE_WINSOCK2_H
-# include <winsock2.h>
-#else
-# include <sys/types.h>
-# include <sys/stat.h>
-#endif
-
#include <boost/scoped_array.hpp>
#include <string>
@@ -493,8 +482,6 @@
fn_call call(this, env, args);
onDataHandler->call(call);
-
- // TODO: clear the stack ?
}
}
=== modified file 'utilities/flvdumper.cpp'
--- a/utilities/flvdumper.cpp 2009-02-25 22:33:03 +0000
+++ b/utilities/flvdumper.cpp 2009-04-23 14:46:54 +0000
@@ -19,6 +19,9 @@
#include "gnashconfig.h"
#endif
+#include "GnashFileUtilities.h"
+#include "GnashSystemNetHeaders.h"
+
#include <boost/shared_ptr.hpp>
#include <dirent.h>
#include <iostream>
@@ -26,14 +29,6 @@
#include <cstring>
#include <string>
#include <vector>
-#include <sys/stat.h>
-#if !defined(HAVE_WINSOCK_H) || defined(__OS2__)
-# include <sys/types.h>
-# include <arpa/inet.h>
-#else
-# include <windows.h>
-# include <io.h>
-#endif
#ifdef ENABLE_NLS
# include <locale>
=== modified file 'utilities/processor.cpp'
--- a/utilities/processor.cpp 2009-04-15 05:33:51 +0000
+++ b/utilities/processor.cpp 2009-04-23 14:46:54 +0000
@@ -32,7 +32,6 @@
#include <iostream>
#include <cstdio>
#include <cstdlib>
-#include <sys/time.h>
#include <ctime>
#ifdef ENABLE_NLS
=== modified file 'utilities/soldumper.cpp'
--- a/utilities/soldumper.cpp 2009-02-25 22:33:03 +0000
+++ b/utilities/soldumper.cpp 2009-04-23 14:46:54 +0000
@@ -19,11 +19,10 @@
#include "gnashconfig.h"
#endif
-#include <dirent.h>
+#include "GnashFileUtilities.h"
#include <iostream>
-#include <stdarg.h>
+#include <cstdarg>
#include <cstring>
-#include <sys/stat.h>
#ifdef ENABLE_NLS
# include <locale>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r10826: Add two more compatibility headers for Net (ntohs etc) and FD (select),
Benjamin Wolsey <=