# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

{
  'variables': {
    'chromium_code': 1,
  },
  'targets': [
    {
      'target_name': 'memory_watcher',
      'type': 'shared_library',
      'dependencies': [
        '../../base/base.gyp:base',
        '../../ui/gfx/gfx.gyp:gfx',
      ],
      'defines': [
        'BUILD_MEMORY_WATCHER',
      ],
      'include_dirs': [
        '../..',
        '<(DEPTH)/third_party/wtl/include',
      ],
      # "/GS can not protect parameters and local variables from local buffer
      # overrun because optimizations are disabled in function". Nothing to be
      # done about this warning.
      'msvs_disabled_warnings': [ 4748 ],
      'sources': [
        'call_stack.cc',
        'call_stack.h',
        'dllmain.cc',
        'hotkey.h',
        'ia32_modrm_map.cc',
        'ia32_opcode_map.cc',
        'memory_hook.cc',
        'memory_hook.h',
        'memory_watcher.cc',
        'memory_watcher.h',
        'mini_disassembler.cc',
        'preamble_patcher.cc',
        'preamble_patcher.h',
        'preamble_patcher_with_stub.cc',
      ],
    },
  ],
}

@@ -566,16 +566,21 @@
 %0A      #
+ 4748
  %22/GS ca
@@ -638,23 +638,16 @@
 ocal
- buffer
 %0A      #
  ove
@@ -642,16 +642,23 @@
 %0A      #
+ buffer
  overrun
@@ -706,16 +706,148 @@
 nction%22.
+%0A      # 4740 %22flow in or out of inline asm code suppresses global optimization%22%0A      # (result of __asm call x, __asm x:).%0A      #
  Nothing
@@ -852,24 +852,16 @@
 ng to be
-%0A      #
  done ab
@@ -870,18 +870,19 @@
 t th
-is
+ese
  warning
 .%0A  
@@ -877,16 +877,17 @@
  warning
+s
 .%0A      
@@ -918,16 +918,22 @@
 : %5B 4748
+, 4740
  %5D,%0A    

Fix memory_watcher compile failure (Windows, VS2010e, Release).