Browse Source

Z991239-527 #comment fix: linux下编译 winpr/file.h 的依赖

gifur 5 years ago
parent
commit
f7bc46b87f
3 changed files with 13 additions and 10 deletions
  1. 1 1
      Common/RVCComm.h
  2. 10 9
      spshell/app.cpp
  3. 2 0
      spshell/log.cpp

+ 1 - 1
Common/RVCComm.h

@@ -10,7 +10,7 @@
 #else
 #define RVCCOMM_API __declspec(dllimport)
 #endif
-# elif ( defined(__GUNC__) &&  __GUNC__ >= 4 )
+# elif ( defined(__GNUC__) &&  __GNUC__ >= 4 )
 #define RVCCOMM_API __attribute__((visibility("default")))
 #else // _WIN32
 #define RVCCOMM_API

+ 10 - 9
spshell/app.cpp

@@ -26,6 +26,7 @@
 #include "SpShellConsole.h"
 #endif //_WIN32
 #include <winpr/crt.h>
+#include <winpr/file.h>
 
 struct app_t g_app;
 
@@ -376,23 +377,21 @@ int app_init(const sp_cfg_start_args_t* args)
 	}
 	sp_dbg_info("kickoff startlist thread proc ok!");
 
-#ifdef _DEBUG
+#if defined(RVC_OS_WIN) && defined(WITH_DEBUG)
+
 	// start console service
 	int nConsolePort = env->cfg->shell_ini->nConsolePort;
-	if (nConsolePort >0)
-	{
+	if (nConsolePort > 0) {
 		g_app.pConsole = new CSpShellConsole();
-		if (!g_app.pConsole->StartListen(nConsolePort))
-		{
+		if (!g_app.pConsole->StartListen(nConsolePort)) {
 			sp_dbg_error("start spshell console service at port %d fail, %s", nConsolePort, g_app.pConsole->GetLastErrorMsg());
 			return Error_Unexpect;
 		}
 
 		sp_dbg_info("start spshell console service at port %d ok!", nConsolePort);
 	}
-#endif
-
 
+#endif // RVC_OS_WIN && WITH_DEBUG
 
 #ifdef _WIN32
 	sp_runtask_startprocess();
@@ -407,13 +406,15 @@ int app_term()
 {
 	int rc;
 
-#ifdef _DEBUG
+#if defined(RVC_OS_WIN) && defined(WITH_DEBUG)
+
 	if (g_app.pConsole != NULL) {
 		g_app.pConsole->StopListen();
 		//delete g_app.pConsole;
 		g_app.pConsole = NULL;
 	}
-#endif //_DEBUG
+
+#endif //defined(RVC_OS_WIN) && defined(WITH_DEBUG)
 
 	/*kill all children process ?*/
 	rc = sp_mod_mgr_terminate_all_entity(sp_get_env()->mod_mgr, 0/*SP_SHELL_SVC_ID*/);

+ 2 - 0
spshell/log.cpp

@@ -11,6 +11,8 @@
 #include "fileutil.h"
 #include "strutil.h"
 
+#include <winpr/file.h>
+
 #ifdef _WIN32
 #include "SpShellConsole.h"
 #endif //_WIN32