rtm.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * File : rtm.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. */
  10. #ifndef __RTM_H__
  11. #define __RTM_H__
  12. #include <rtdef.h>
  13. #include <rtthread.h>
  14. #ifdef RT_USING_MODULE
  15. struct rt_module_symtab
  16. {
  17. void *addr;
  18. const char *name;
  19. };
  20. #if defined(_MSC_VER) || defined(__MINGW32__)
  21. #define RTM_EXPORT(symbol)
  22. #else
  23. #define RTM_EXPORT(symbol) \
  24. const char __rtmsym_##symbol##_name[] = #symbol; \
  25. const struct rt_module_symtab __rtmsym_##symbol SECTION("RTMSymTab")= \
  26. { \
  27. (void *)&symbol, \
  28. __rtmsym_##symbol##_name \
  29. };
  30. #endif
  31. #else
  32. #define RTM_EXPORT(symbol)
  33. #endif
  34. #endif