omc_inline.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * This file is part of OpenModelica.
  3. *
  4. * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC),
  5. * c/o Linköpings universitet, Department of Computer and Information Science,
  6. * SE-58183 Linköping, Sweden.
  7. *
  8. * All rights reserved.
  9. *
  10. * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF THE BSD NEW LICENSE OR THE
  11. * GPL VERSION 3 LICENSE OR THE OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2.
  12. * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES
  13. * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3,
  14. * ACCORDING TO RECIPIENTS CHOICE.
  15. *
  16. * The OpenModelica software and the OSMC (Open Source Modelica Consortium)
  17. * Public License (OSMC-PL) are obtained from OSMC, either from the above
  18. * address, from the URLs: http://www.openmodelica.org or
  19. * http://www.ida.liu.se/projects/OpenModelica, and in the OpenModelica
  20. * distribution. GNU version 3 is obtained from:
  21. * http://www.gnu.org/copyleft/gpl.html. The New BSD License is obtained from:
  22. * http://www.opensource.org/licenses/BSD-3-Clause.
  23. *
  24. * This program is distributed WITHOUT ANY WARRANTY; without even the implied
  25. * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, EXCEPT AS
  26. * EXPRESSLY SET FORTH IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE
  27. * CONDITIONS OF OSMC-PL.
  28. *
  29. */
  30. #ifndef INLINE_H_
  31. #define INLINE_H_
  32. #if defined(_MSC_VER)
  33. /* Visual C/C++
  34. "inline" is a proper keyword in Visual C++ and it is an error to macroize it from VS2012 (_MSC_VER=1700);
  35. so, macroize it only for Visual C where "inline" is not available */
  36. #ifndef __cplusplus
  37. # ifndef inline
  38. # define inline __inline
  39. # endif
  40. #endif
  41. #elif defined(__GNUC__)
  42. /* GCC */
  43. # ifndef inline
  44. # define inline __inline__
  45. # endif
  46. #else
  47. /* Otherwise, leave inline undefined, all functions
  48. * using inline is also static, so it will hold. */
  49. #endif
  50. #endif /* INLINE_H_ */