summaryrefslogtreecommitdiff
path: root/plugins/modernb/_disabled_src/stdafx.cpp
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-05-15 10:38:20 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-05-15 10:38:20 +0000
commit48540940b6c28bb4378abfeb500ec45a625b37b6 (patch)
tree2ef294c0763e802f91d868bdef4229b6868527de /plugins/modernb/_disabled_src/stdafx.cpp
parent5c350913f011e119127baeb32a6aedeb4f0d33bc (diff)
initial commit
git-svn-id: http://svn.miranda-ng.org/main/trunk@2 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/modernb/_disabled_src/stdafx.cpp')
-rw-r--r--plugins/modernb/_disabled_src/stdafx.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/plugins/modernb/_disabled_src/stdafx.cpp b/plugins/modernb/_disabled_src/stdafx.cpp
new file mode 100644
index 0000000000..6856e97c85
--- /dev/null
+++ b/plugins/modernb/_disabled_src/stdafx.cpp
@@ -0,0 +1,56 @@
+// stdafx.cpp : source file that includes just the standard includes
+// MMXSwarm.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+// Also includes utility functions that rarely change.
+//
+// This is a part of the Microsoft Foundation Classes C++ library.
+// Copyright (c) Microsoft Corporation. All rights reserved.
+//
+// This source code is only intended as a supplement to the
+// Microsoft Foundation Classes Reference and related
+// electronic documentation provided with the library.
+// See these sources for detailed information regarding the
+// Microsoft Foundation Classes product.
+//
+#include "stdafx.h"
+#include <windows.h>
+#include <stdio.h>
+
+static bool _IsMMX();
+
+bool IsMMX()
+{
+ static bool bMMX = _IsMMX();
+ return(bMMX);
+}
+
+static bool _IsMMX()
+{
+ // This bit flag can get set on calling cpuid
+ // with register eax set to 1
+ const int _MMX_FEATURE_BIT = 0x00800000;
+ DWORD dwFeature = 0;
+ __try {
+ _asm {
+ mov eax,1
+ cpuid
+ mov dwFeature,edx
+ }
+ } __except ( EXCEPTION_EXECUTE_HANDLER) {
+ return false;
+ }
+ if (dwFeature & _MMX_FEATURE_BIT) {
+ __try {
+ __asm {
+ pxor mm0, mm0
+ emms
+ }
+ } __except (EXCEPTION_EXECUTE_HANDLER) {
+ return (0);
+ }
+ return(true);
+ }
+
+ return false;
+}
+