fork download
  1. /*
  2.   test_dll.h
  3. */
  4.  
  5. #ifndef __TEST_DLL_H__
  6. #define __TEST_DLL_H__
  7.  
  8. #ifdef __TEST_DLL_MAKE_DLL_
  9. #define __PORT __declspec(dllexport) // make dll mode
  10. #else
  11. #define __PORT __declspec(dllimport) // use dll mode
  12. #endif
  13.  
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17.  
  18. __PORT BOOL APIENTRY DllMain(HINSTANCE, WORD, LPVOID);
  19. __PORT int WINAPI test(int);
  20.  
  21. #ifdef __cplusplus
  22. }
  23. #endif
  24.  
  25. #endif // __TEST_DLL_H__
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:11:16: warning: return type defaults to ‘int’ [-Wreturn-type]
 #define __PORT __declspec(dllimport) // use dll mode
                ^
prog.c:18:1: note: in expansion of macro ‘__PORT’
 __PORT BOOL APIENTRY DllMain(HINSTANCE, WORD, LPVOID);
 ^
prog.c: In function ‘__declspec’:
prog.c:18:8: error: unknown type name ‘BOOL’
 __PORT BOOL APIENTRY DllMain(HINSTANCE, WORD, LPVOID);
        ^
prog.c:18:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘DllMain’
 __PORT BOOL APIENTRY DllMain(HINSTANCE, WORD, LPVOID);
                      ^
prog.c:11:16: error: expected declaration specifiers before ‘__declspec’
 #define __PORT __declspec(dllimport) // use dll mode
                ^
prog.c:19:1: note: in expansion of macro ‘__PORT’
 __PORT int WINAPI test(int);
 ^
prog.c:11:16: error: expected ‘{’ at end of input
 #define __PORT __declspec(dllimport) // use dll mode
                ^
prog.c:19:1: note: in expansion of macro ‘__PORT’
 __PORT int WINAPI test(int);
 ^
prog.c:11:16: warning: control reaches end of non-void function [-Wreturn-type]
 #define __PORT __declspec(dllimport) // use dll mode
                ^
prog.c:19:1: note: in expansion of macro ‘__PORT’
 __PORT int WINAPI test(int);
 ^
stdout
Standard output is empty