Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Side by Side Diff: native_client_sdk/src/libraries/nacl_io_test/pepper_interface_mock.cc

Issue 13998024: [NaCl SDK] nacl_io: fix warning of macro redefinition on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io_test/pepper_interface_mock.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 5
6 #include "pepper_interface_mock.h" 6 #include "pepper_interface_mock.h"
7 7
8 PepperInterfaceMock::PepperInterfaceMock(PP_Instance instance) 8 PepperInterfaceMock::PepperInterfaceMock(PP_Instance instance)
9 : instance_(instance), 9 : instance_(instance),
10 10
11 // Initialize interfaces. 11 // Initialize interfaces.
12 #include "nacl_io/pepper/undef_macros.h"
12 #include "nacl_io/pepper/define_empty_macros.h" 13 #include "nacl_io/pepper/define_empty_macros.h"
13 #undef BEGIN_INTERFACE 14 #undef BEGIN_INTERFACE
14 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ 15 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \
15 BaseClass##interface_(new BaseClass##Mock), 16 BaseClass##interface_(new BaseClass##Mock),
16 #include "nacl_io/pepper/all_interfaces.h" 17 #include "nacl_io/pepper/all_interfaces.h"
17 #include "nacl_io/pepper/undef_macros.h"
18 18
19 // Dummy value so we can ensure that no interface ends the initializer list. 19 // Dummy value so we can ensure that no interface ends the initializer list.
20 dummy_(0) { 20 dummy_(0) {
21 } 21 }
22 22
23 PepperInterfaceMock::~PepperInterfaceMock() { 23 PepperInterfaceMock::~PepperInterfaceMock() {
24 24
25 // Delete interfaces. 25 // Delete interfaces.
26 #include "nacl_io/pepper/undef_macros.h"
26 #include "nacl_io/pepper/define_empty_macros.h" 27 #include "nacl_io/pepper/define_empty_macros.h"
27 #undef BEGIN_INTERFACE 28 #undef BEGIN_INTERFACE
28 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ 29 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \
29 delete BaseClass##interface_; 30 delete BaseClass##interface_;
30 #include "nacl_io/pepper/all_interfaces.h" 31 #include "nacl_io/pepper/all_interfaces.h"
31 #include "nacl_io/pepper/undef_macros.h"
32 32
33 } 33 }
34 34
35 PP_Instance PepperInterfaceMock::GetInstance() { 35 PP_Instance PepperInterfaceMock::GetInstance() {
36 return instance_; 36 return instance_;
37 } 37 }
38 38
39 // Define Getter functions, constructors, destructors. 39 // Define Getter functions, constructors, destructors.
40 #include "nacl_io/pepper/undef_macros.h"
40 #include "nacl_io/pepper/define_empty_macros.h" 41 #include "nacl_io/pepper/define_empty_macros.h"
41 #undef BEGIN_INTERFACE 42 #undef BEGIN_INTERFACE
42 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \ 43 #define BEGIN_INTERFACE(BaseClass, PPInterface, InterfaceString) \
43 BaseClass##Mock* PepperInterfaceMock::Get##BaseClass() { \ 44 BaseClass##Mock* PepperInterfaceMock::Get##BaseClass() { \
44 return BaseClass##interface_; \ 45 return BaseClass##interface_; \
45 } \ 46 } \
46 BaseClass##Mock::BaseClass##Mock() { \ 47 BaseClass##Mock::BaseClass##Mock() { \
47 } \ 48 } \
48 BaseClass##Mock::~BaseClass##Mock() { \ 49 BaseClass##Mock::~BaseClass##Mock() { \
49 } 50 }
50 #include "nacl_io/pepper/all_interfaces.h" 51 #include "nacl_io/pepper/all_interfaces.h"
51 #include "nacl_io/pepper/undef_macros.h"
OLDNEW
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io_test/pepper_interface_mock.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698