#ifndef EXAMPLE1_H_ #define EXAMPLE1_H_ #include "example2.h" #if defined(__cplusplus) extern "C" { #endif struct ForwardDeclaration; int uses_forward_decl(struct ForwardDeclaration *); struct Hello { int foo; int bar; wchar_t d; enum {A, B} enum_field; enum {C, D} enum_field2; struct { int a; int b; struct { int c; }; }; }; #if defined(__cplusplus) } // extern "C" #endif using namespace test2; using namespace test3; typedef float float_type; typedef const float_type cfloat_type; struct CPPHello : private HelloAgain, public ByeAgain { const int cpp_foo; cfloat_type cpp_bar; virtual int again() { return 0; } CPPHello() : cpp_foo(20), cpp_bar(1.234) {} CPPHello(CPPHello &) = delete; enum Bla{BLA = 1}; int test_enum() {return CPPHello::BLA;} }; void fooVariadic (int &, int *, ...); int boo (const CPPHello, int *, float *) { return CPPHello::BLA; } template struct StackNode { public: T value_; StackNode* next_; public: StackNode(T t, StackNode* next = nullptr) : value_(static_cast(t)), next_(next) {} }; template class Stack { private: StackNode* head_; public: Stack() : head_(nullptr) {} void push(T t) { head_ = new StackNode(static_cast(t), head_); } T pop() { StackNode* cur = head_; head_ = cur->next_; T res = static_cast(cur->value_); delete cur; return res; } }; // Replicated from libsysutils. template class List { public: /* * One element in the list. */ class _Node { public: explicit _Node(const T& val) : mVal(val) {} ~_Node() {} inline T& getRef() { return mVal; } inline const T& getRef() const { return mVal; } private: void PrivateNode(); friend class List; friend class _ListIterator; T mVal; _Node* mpPrev; _Node* mpNext; }; _Node *middle; }; typedef List float_list; float_list float_list_test; typedef List int_list; int_list int_list_test; List::_Node node(2); int ListMangle(int_list *, StackNode *); template List castInterface(List parent, const char *childIndicator, bool emitError) {return List();} void format() { castInterface(List(), "foo", true); } #endif // EXAMPLE1_H_