callin-arg.cpp 678 B

1234567891011121314151617181920212223242526272829303132
  1. #include "cxxcall.hpp"
  2. #include <stdexcept>
  3. #include <cstdio>
  4. #if defined (CXXCALL_AMD64)
  5. #include "sysdeps/x86-64/callin-arg.cpp"
  6. #elif defined (CXXCALL_I386)
  7. #include "sysdeps/i386/callin-arg.cpp"
  8. #elif defined (CXXCALL_ARM64)
  9. #include "sysdeps/aarch64/callin-arg.cpp"
  10. #elif defined (CXXCALL_ARM32)
  11. #include "sysdeps/arm/callin-arg.cpp"
  12. #else
  13. # error "unsupported platform"
  14. #endif
  15. namespace cxxcall
  16. {
  17. void cb_data::_Assert_rtype (int type)
  18. {
  19. if (type != this->rtype)
  20. {
  21. char buf[100];
  22. sprintf (buf, "Invalid return type (got %d, expected %d)",
  23. type, (int)this->rtype);
  24. throw std::runtime_error (buf);
  25. }
  26. }
  27. } // namespace cxxcall