[vlc-commits] bdagraph: build with mingw-w64
Rafaël Carré
git at videolan.org
Mon Feb 27 19:20:46 CET 2012
vlc/vlc-2.0 | branch: master | Rafaël Carré <funman at videolan.org> | Fri Feb 3 13:59:06 2012 -0500| [1b37b0ce30b053c34725d6e8b265c676da55f8b2] | committer: Rafaël Carré
bdagraph: build with mingw-w64
use _snwprintf instead of unsafe wsprintfW
define NO_DSHOW_STRSAFE to not ask for secure replacements
remove now meaningless very old mingw.org workarounds
(cherry picked from commit bb7509af051d8384b9266bcdb345c553f608559c)
Signed-off-by: Rafaël Carré <funman at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=1b37b0ce30b053c34725d6e8b265c676da55f8b2
---
modules/access/dtv/bdagraph.cpp | 4 +++-
modules/access/dtv/bdagraph.hpp | 31 +++++++++----------------------
2 files changed, 12 insertions(+), 23 deletions(-)
diff --git a/modules/access/dtv/bdagraph.cpp b/modules/access/dtv/bdagraph.cpp
index 23f6818..5ef3ac5 100644
--- a/modules/access/dtv/bdagraph.cpp
+++ b/modules/access/dtv/bdagraph.cpp
@@ -2041,8 +2041,10 @@ HRESULT BDAGraph::Register()
return hr;
}
- wsprintfW( psz_w_graph_name, L"VLC BDA Graph %08x Pid %08x",
+ size_t len = sizeof(psz_w_graph_name) / sizeof(psz_w_graph_name[0]);
+ _snwprintf( psz_w_graph_name, len - 1, L"VLC BDA Graph %08x Pid %08x",
(DWORD_PTR) p_filter_graph, ::GetCurrentProcessId() );
+ psz_w_graph_name[len-1] = 0;
hr = CreateItemMoniker( L"!", psz_w_graph_name, &l.p_moniker );
if( FAILED( hr ) )
{
diff --git a/modules/access/dtv/bdagraph.hpp b/modules/access/dtv/bdagraph.hpp
index a4b61ab..0048cf5 100644
--- a/modules/access/dtv/bdagraph.hpp
+++ b/modules/access/dtv/bdagraph.hpp
@@ -25,30 +25,17 @@
*****************************************************************************/
using namespace std;
-#ifndef _MSC_VER
-# include <wtypes.h>
-# include <unknwn.h>
-# include <ole2.h>
-# include <limits.h>
-# ifdef _WINGDI_
-# undef _WINGDI_
-# endif
-# define _WINGDI_ 1
-# define AM_NOVTABLE
-# define _OBJBASE_H_
-# undef _X86_
-# ifndef _I64_MAX
-# define _I64_MAX 0x7FFFFFFFFFFFFFFFLL
-# endif
-# define LONGLONG long long
-/* Work-around a bug in w32api-2.5 */
-/* # define QACONTAINERFLAGS QACONTAINERFLAGS_SOMETHINGELSE */
-#endif
-
-/* Needed to call CoInitializeEx */
-#define _WIN32_DCOM
+#include <wtypes.h>
+#include <unknwn.h>
+#include <ole2.h>
+#include <limits.h>
+
+/* FIXME: mingw.org doesn't define secure versions of
+ * http://msdn.microsoft.com/en-us/library/f30dzcf6.aspxu */
+#define NO_DSHOW_STRSAFE
#include <dshow.h>
+
#include <comcat.h>
#include "dtv/bdadefs.h"
More information about the vlc-commits
mailing list