fork download
  1.  
  2. //currently not needed
  3. //template<typename T> struct alignment_trick { char c; T member; };
  4. //#define ALIGNOF(type) offsetof (alignment_trick<type>, member)
  5.  
  6. #ifdef _WIN32
  7. #include <windows.h>
  8. #define sleep_ms(x) Sleep(x)
  9. #endif
  10.  
  11. #ifdef _MSC_VER
  12. #define ALIGNOF(x) __alignof(x)
  13. #define strtok_r(x, y, z) strtok_s(x, y, z)
  14. #define strtof(x, y) (float)strtod(x, y)
  15. #define strtoll(x, y, z) _strtoi64(x, y, z)
  16. #define strtoull(x, y, z) _strtoui64(x, y, z)
  17. #else
  18. #include <unistd.h>
  19. #include <stdint.h> //for uintptr_t
  20.  
  21. #define ALIGNOF(x) __alignof__(x)
  22. #define sleep_ms(x) usleep(x*1000)
  23. #endif
  24.  
  25. #ifdef __MINGW32__
  26. #define strtok_r(s,d,p) strtok(s,d)
  27. #endif
  28.  
  29. #define PADDING(x, y) ((ALIGNOF(y) - ((uintptr_t)(x) & (ALIGNOF(y) - 1))) & (ALIGNOF(y) - 1))
  30.  
  31.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
stdout
Standard output is empty