android.cxx 784 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include "android.h"
  2. #ifndef STL_NONE
  3. #include <cmath>
  4. #include <cstdio>
  5. #ifndef STL_SYSTEM
  6. #include <exception>
  7. #include <typeinfo>
  8. #ifndef STL_GABI
  9. #include <iostream>
  10. #include <string>
  11. #endif
  12. #endif
  13. #endif
  14. int main()
  15. {
  16. #if !defined(STL_NONE)
  17. // Require -lm implied by linking as C++.
  18. std::printf("%p\n", static_cast<double (*)(double)>(&std::sin));
  19. #endif
  20. #if defined(STL_NONE)
  21. return 0;
  22. #elif defined(STL_SYSTEM)
  23. return 0;
  24. #else
  25. try {
  26. delete (new int);
  27. } catch (std::exception const& e) {
  28. #if defined(STL_GABI)
  29. e.what();
  30. typeid(e).name();
  31. #else
  32. std::cerr << e.what() << std::endl;
  33. std::cerr << typeid(e).name() << std::endl;
  34. #endif
  35. }
  36. #if defined(STL_GABI)
  37. return 0;
  38. #else
  39. std::string s;
  40. return static_cast<int>(s.size());
  41. #endif
  42. #endif
  43. }