OpenSDE Framework (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.2 KiB

  1. /*
  2. * --- T2-COPYRIGHT-NOTE-BEGIN ---
  3. * This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. *
  5. * T2 SDE: architecture/share/archtest.c
  6. * Copyright (C) 2004 - 2006 The T2 SDE Project
  7. *
  8. * More information can be found in the files COPYING and README.
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; version 2 of the License. A copy of the
  13. * GNU General Public License can be found in the file COPYING.
  14. * --- T2-COPYRIGHT-NOTE-END ---
  15. */
  16. #include <stdio.h>
  17. char * isbigendian () {
  18. /* Are we little or big endian? From Harbison&Steele. */
  19. union { long l; char c[sizeof (long)]; } u;
  20. u.l=1; return (u.c[0] == 1)?"no":"yes";
  21. }
  22. int main() {
  23. printf("arch_sizeof_short=%d\n",sizeof(short));
  24. printf("arch_sizeof_int=%d\n",sizeof(int));
  25. printf("arch_sizeof_long=%d\n",sizeof(long));
  26. printf("arch_sizeof_long_long=%d\n",sizeof(long long));
  27. printf("arch_sizeof_char_p=%d\n",sizeof(char *));
  28. printf("arch_bigendian=%s\n",isbigendian());
  29. printf("arch_machine="); fflush(stdout); system("uname -m");
  30. system("echo arch_target=`uname -m -p | tr ' ' -`-linux");
  31. return 0;
  32. }