]> git.saurik.com Git - apple/dyld.git/blob - testing/kernel-cache-tests/kext-vtable-patching-arm64e/foo.cpp
dyld-851.27.tar.gz
[apple/dyld.git] / testing / kernel-cache-tests / kext-vtable-patching-arm64e / foo.cpp
1
2 #include "foo.h"
3
4 OSDefineMetaClassAndStructors( Foo, OSObject )
5
6 // Redefine this just so that we can write tests
7 #undef OSMetaClassDefineReservedUnused
8 #define OSMetaClassDefineReservedUnused(className, index) \
9 void className ::_RESERVED ## className ## index () \
10 { gMetaClass.reservedCalled(index); }
11
12 // Index 0 has been replaced with a method
13 OSMetaClassDefineReservedUsed(Foo, 0)
14 OSMetaClassDefineReservedUnused( Foo, 1 )
15 OSMetaClassDefineReservedUnused( Foo, 2 )
16 OSMetaClassDefineReservedUnused( Foo, 3 )
17
18 int Foo::foo() {
19 return 0;
20 }
21
22 int Foo::fooUsed0() {
23 return 0;
24 }
25
26 int foo() {
27 Foo* foo = new Foo();
28 return foo->foo() + foo->fooUsed0();
29 }