Created
October 7, 2014 14:21
-
-
Save myzone/fb40b6f9809688c8b82f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _CPLUSPLUS_H | |
#define _CPLUSPLUS_H | |
/* | |
This is applicable if using virtual inheritance. | |
*/ | |
__extension__ typedef int __guard __attribute__((mode (__DI__))); | |
extern "C" int __cxa_guard_acquire(__guard *); | |
extern "C" void __cxa_guard_release (__guard *); | |
extern "C" void __cxa_guard_abort (__guard *); | |
int __cxa_guard_acquire(__guard *g) {return !*(char *)(g);}; | |
void __cxa_guard_release (__guard *g) {*(char *)g = 1;}; | |
void __cxa_guard_abort (__guard *) {}; | |
/* | |
This is applicable if using pure virtual inheritance. | |
*/ | |
extern "C" void __cxa_pure_virtual(void); | |
void __cxa_pure_virtual(void) {}; | |
/* | |
Operators required for C++ | |
*/ | |
void* operator new(size_t size); | |
void operator delete(void* size); | |
void * operator new(size_t size) | |
{ | |
return malloc(size); | |
} | |
void operator delete(void* ptr) | |
{ | |
free(ptr); | |
} | |
#endif //_CPLUSPLUS_H |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment