gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. 735abc57632ecd4b572d


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. 735abc57632ecd4b572d42f4bfad8e7125c4783d
Date: Tue, 11 Jan 2011 11:06:30 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  735abc57632ecd4b572d42f4bfad8e7125c4783d (commit)
       via  2424f86e4d019b0791d2841cecc65beabca52365 (commit)
      from  ebb9d7695d8fdfb16c307e52dd7f09cd53649c1c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=735abc57632ecd4b572d42f4bfad8e7125c4783d


commit 735abc57632ecd4b572d42f4bfad8e7125c4783d
Author: Benjamin Wolsey <address@hidden>
Date:   Tue Jan 11 09:55:17 2011 +0100

    Correct include for w32.

diff --git a/libbase/SharedMem.h b/libbase/SharedMem.h
index 4d7b6c1..ef63182 100644
--- a/libbase/SharedMem.h
+++ b/libbase/SharedMem.h
@@ -26,7 +26,8 @@
 #include <boost/cstdint.hpp>
 
 #if defined (WIN32)
-// Include for key_t and HANDLE
+// Include for HANDLE
+#include <windows.h>
 #else
 // key_t
 #include <sys/types.h>

http://git.savannah.gnu.org/cgit//commit/?id=2424f86e4d019b0791d2841cecc65beabca52365


commit 2424f86e4d019b0791d2841cecc65beabca52365
Author: Benjamin Wolsey <address@hidden>
Date:   Tue Jan 11 09:44:21 2011 +0100

    Split w32 shared mem into separate file, drop ifdefs that
    aren't used.

diff --git a/libbase/Makefile.am b/libbase/Makefile.am
index b36160c..11262ab 100644
--- a/libbase/Makefile.am
+++ b/libbase/Makefile.am
@@ -100,9 +100,13 @@ else
 if HAIKU
 libgnashbase_la_SOURCES += SharedMemHaiku.cpp
 else
+if WIN32
+libgnashbase_la_SOURCES += SharedMemW32.cpp
+else
 libgnashbase_la_SOURCES += SharedMem.cpp
 endif
 endif
+endif
 
 edit = sed \
        -e 's|@address@hidden|$(DEFAULT_FLASH_PLATFORM_ID)|g' \
diff --git a/libbase/SharedMem.cpp b/libbase/SharedMem.cpp
index f73776d..d339fc4 100644
--- a/libbase/SharedMem.cpp
+++ b/libbase/SharedMem.cpp
@@ -27,22 +27,7 @@
 #include <cerrno>
 #include <cstring>
 
-#if defined(ANDROID)
-# include <sys/types.h>
-# include <linux/shm.h>
-# include <linux/sem.h>
-extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf);
-extern int semget (key_t __key, int __nsems, int __semflg);
-extern int semop (int __semid, struct sembuf *__sops, size_t __nsops);
-extern int shmdt (__const void *__shmaddr);
-extern void *shmat (int __shmid, __const void *__shmaddr, int __shmflg);
-extern int shmget (key_t __key, size_t __size, int __shmflg);
-extern int semctl (int __semid, int __semnum, int __cmd, ...);
-#elif defined(WIN32)
-# include <windows.h>
-# include <process.h>
-# include <io.h>
-#elif !defined(__riscos__) && !defined(__OS2__) && !defined(HAIKU_HOST)
+#if !defined(__riscos__) && !defined(__OS2__) 
 # include <sys/types.h>
 # include <sys/shm.h>
 # include <sys/sem.h>
@@ -51,7 +36,7 @@ extern int semctl (int __semid, int __semnum, int __cmd, ...);
 
 #include "log.h"
 
-#if (defined(USE_SYSV_SHM) && defined(HAVE_SHMGET)) || defined(_WIN32) || 
defined(ANDROID)
+#if (defined(USE_SYSV_SHM) && defined(HAVE_SHMGET)) 
 # define ENABLE_SHARED_MEM 1
 #else
 # undef ENABLE_SHARED_MEM
@@ -77,7 +62,7 @@ SharedMem::~SharedMem()
 {
     // Nothing to do if we were never attached.
     if (!_addr) return;
-#ifndef _WIN32
+
     if (::shmdt(_addr) < 0) {
         const int err = errno;
         log_error("Error detaching shared memory: %s", std::strerror(err));
@@ -100,36 +85,22 @@ SharedMem::~SharedMem()
         }
     }
 #endif
-
-#else
-    // Windows code here.
-#endif
 }
 
 bool
 SharedMem::lock() const
 {
-#ifndef _WIN32
     struct sembuf sb = { 0, -1, SEM_UNDO };
     const int ret = ::semop(_semid, &sb, 1);
     return ret >= 0;
-#else
-    // Windows code here.
-    return false;
-#endif
 }
 
 bool
 SharedMem::unlock() const
 {
-#ifndef _WIN32
     struct sembuf sb = { 0, 1, SEM_UNDO };
     const int ret = ::semop(_semid, &sb, 1);
     return ret >= 0;
-#else
-    // Windows code here
-    return false;
-#endif
 }
 
 bool
@@ -154,10 +125,6 @@ SharedMem::attach()
     log_debug("Using shared memory key %s",
             boost::io::group(std::hex, std::showbase, _shmkey));
 
-#ifdef _WIN32
-    return false;
-#else
-
     // First get semaphore.
     
     // Check if it exists already.
@@ -227,7 +194,6 @@ SharedMem::attach()
 
     assert(_addr);
     return true;
-#endif
 }
 
 } // end of gnash namespace
diff --git a/libbase/SharedMem.h b/libbase/SharedMem.h
index 1b66fdf..4d7b6c1 100644
--- a/libbase/SharedMem.h
+++ b/libbase/SharedMem.h
@@ -25,19 +25,11 @@
 
 #include <boost/cstdint.hpp>
 
-#include <sys/types.h>
-#if !defined(HAVE_WINSOCK_H) && !defined(__riscos__) && !defined(__OS2__) && 
!defined(__HAIKU__)
-# include <sys/ipc.h>
-#ifdef ANDROID
-# include <linux/shm.h>
+#if defined (WIN32)
+// Include for key_t and HANDLE
 #else
-# include <sys/shm.h>
-#endif
-#elif !defined(__riscos__) && !defined(__OS2__) && !defined(__HAIKU__)
-# include <windows.h>
-# include <process.h>
-# include <fcntl.h>
-# include <io.h>
+// key_t
+#include <sys/types.h>
 #endif
 
 #include "dsodefs.h" //For DSOEXPORT
@@ -49,13 +41,6 @@ namespace gnash {
 
 namespace gnash {
 
-#ifndef MAP_INHERIT
-const int MAP_INHERIT = 0;
-#endif
-#ifndef MAP_HASSEMAPHORE
-const int MAP_HASSEMAPHORE = 0;
-#endif
-
 class SharedMem
 {
 public:
@@ -129,11 +114,11 @@ private:
     // Shared memory ID.
     int _shmid;
 
-#if !defined(HAVE_WINSOCK_H) || defined(__OS2__)
-    key_t      _shmkey;
+#if !defined(WIN32) 
+    key_t _shmkey;
 #else
-    long       _shmkey;
-    HANDLE      _shmhandle;
+    long _shmkey;
+    HANDLE _shmhandle;
 #endif
 };
 
diff --git a/libbase/SharedMemHaiku.cpp b/libbase/SharedMemHaiku.cpp
index fa1d6fa..db28e9b 100644
--- a/libbase/SharedMemHaiku.cpp
+++ b/libbase/SharedMemHaiku.cpp
@@ -60,14 +60,14 @@ SharedMem::~SharedMem()
 }
 
 bool
-SharedMem::lock()
+SharedMem::lock() const
 {
     log_unimpl(_("%s on Haiku"), __FUNCTION__);
     return false;
 }
 
 bool
-SharedMem::unlock()
+SharedMem::unlock() const
 {
     log_unimpl(_("%s on Haiku"), __FUNCTION__);
     return false;
diff --git a/libbase/SharedMemHaiku.cpp b/libbase/SharedMemW32.cpp
similarity index 66%
copy from libbase/SharedMemHaiku.cpp
copy to libbase/SharedMemW32.cpp
index fa1d6fa..c6bb1fd 100644
--- a/libbase/SharedMemHaiku.cpp
+++ b/libbase/SharedMemW32.cpp
@@ -1,4 +1,5 @@
-// 
+// SharedMem implementation for w32
+//
 //   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
 //   Foundation, Inc
 // 
@@ -16,26 +17,18 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-// This is generated by autoconf
 #ifdef HAVE_CONFIG_H
 # include "gnashconfig.h"
 #endif
 
-#include <sys/types.h>
-#if !defined(HAVE_WINSOCK_H) && !defined(__riscos__) && !defined(__OS2__) && 
!defined(__HAIKU__) && !defined(ANDROID)
-# include <sys/ipc.h>
-# include <sys/shm.h>
-#elif !defined(__riscos__) && !defined(__OS2__) && !defined(__HAIKU__) && 
!defined(ANDROID)
+#include "SharedMem.h"
 
-# include <windows.h>
-# include <process.h>
-# include <fcntl.h>
-# include <io.h>
-#endif
+#include <windows.h>
+#include <process.h>
+#include <io.h>
 
 #include "log.h"
 #include "rc.h"
-#include "SharedMem.h"
 
 namespace {
     gnash::RcInitFile& rcfile = gnash::RcInitFile::getDefaultInstance();
@@ -51,32 +44,32 @@ SharedMem::SharedMem(size_t size)
     _shmid(0),
     _shmkey(0)
 {
-    log_unimpl(_("%s on Haiku"), __FUNCTION__);
+    log_unimpl(_("%s on w32"), __FUNCTION__);
 }
 
 SharedMem::~SharedMem()
 {
-    log_unimpl(_("%s on Haiku"), __FUNCTION__);
+    log_unimpl(_("%s on w32"), __FUNCTION__);
 }
 
 bool
-SharedMem::lock()
+SharedMem::lock() const
 {
-    log_unimpl(_("%s on Haiku"), __FUNCTION__);
+    log_unimpl(_("%s on w32"), __FUNCTION__);
     return false;
 }
 
 bool
-SharedMem::unlock()
+SharedMem::unlock() const
 {
-    log_unimpl(_("%s on Haiku"), __FUNCTION__);
+    log_unimpl(_("%s on w32"), __FUNCTION__);
     return false;
 }
 
 bool
 SharedMem::attach()
 {
-    log_unimpl(_("%s on Haiku"), __FUNCTION__);
+    log_unimpl(_("%s on w32"), __FUNCTION__);
     return false;
 }
 

-----------------------------------------------------------------------

Summary of changes:
 libbase/Makefile.am                              |    4 ++
 libbase/SharedMem.cpp                            |   40 ++--------------------
 libbase/SharedMem.h                              |   32 +++++------------
 libbase/SharedMemHaiku.cpp                       |    4 +-
 libbase/{SharedMemHaiku.cpp => SharedMemW32.cpp} |   33 +++++++-----------
 5 files changed, 31 insertions(+), 82 deletions(-)
 copy libbase/{SharedMemHaiku.cpp => SharedMemW32.cpp} (66%)


hooks/post-receive
-- 
Gnash



reply via email to

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