os.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * This file is part of the flashrom project.
  3. *
  4. * Copyright (C) 2011 Carl-Daniel Hailfinger
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; version 2 of the License.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  18. */
  19. /*
  20. * Header file for OS checking.
  21. */
  22. // Solaris
  23. #if defined (__sun) && (defined(__i386) || defined(__amd64))
  24. #define __FLASHROM_OS__ "SunOS"
  25. // OS X
  26. #elif defined(__MACH__) && defined(__APPLE__)
  27. #define __FLASHROM_OS__ "Darwin"
  28. // FreeBSD
  29. #elif defined(__FreeBSD__)
  30. #define __FLASHROM_OS__ "FreeBSD"
  31. // DragonFlyBSD
  32. #elif defined(__DragonFly__)
  33. #define __FLASHROM_OS__ "DragonFlyBSD"
  34. // NetBSD
  35. #elif defined(__NetBSD__)
  36. #define __FLASHROM_OS__ "NetBSD"
  37. // OpenBSD
  38. #elif defined(__OpenBSD__)
  39. #define __FLASHROM_OS__ "OpenBSD"
  40. // DJGPP
  41. #elif defined(__DJGPP__)
  42. #define __FLASHROM_OS__ "DOS"
  43. // MinGW (always has _WIN32 available)
  44. #elif defined(__MINGW32__)
  45. #define __FLASHROM_OS__ "MinGW"
  46. // Cygwin (usually without _WIN32)
  47. #elif defined( __CYGWIN__)
  48. #define __FLASHROM_OS__ "Cygwin"
  49. // libpayload
  50. #elif defined(__LIBPAYLOAD__)
  51. #define __FLASHROM_OS__ "libpayload"
  52. // Linux
  53. #elif defined(__linux__)
  54. #define __FLASHROM_OS__ "Linux"
  55. #endif
  56. __FLASHROM_OS__