mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-17 03:30:28 +00:00
27 lines
511 B
C++
27 lines
511 B
C++
|
void call();
|
||
|
|
||
|
struct S {
|
||
|
static void foo() { call(); call(); }
|
||
|
static void bar() { call(); call(); }
|
||
|
static void baz() {}
|
||
|
};
|
||
|
|
||
|
#ifdef FILE1
|
||
|
# define FUNC_NAME func1
|
||
|
# define FUNC_BODY \
|
||
|
S::foo(); S::bar(); S::baz();
|
||
|
#else
|
||
|
# define FUNC_NAME func2
|
||
|
# define FUNC_BODY \
|
||
|
S::bar();
|
||
|
#endif
|
||
|
|
||
|
void FUNC_NAME() {
|
||
|
FUNC_BODY
|
||
|
}
|
||
|
|
||
|
// Build instructions:
|
||
|
// $ clang -g -fPIC -c -DFILE1 arange-overlap.cc -o obj1.o
|
||
|
// $ clang -g -fPIC -c arange-overlap.cc -o obj2.o
|
||
|
// $ clang -shared obj1.o obj2.o -o <output>
|