Browse Source

Z991239-385 #comment _strdup 未声明(但在gcc下编译是不会报错的)

gifur 5 years ago
parent
commit
2e5f05e5fc
3 changed files with 9 additions and 1 deletions
  1. 1 0
      spbase/sp_bcm.c
  2. 2 0
      spbase/sp_pst.c
  3. 6 1
      spbase/sp_var.c

+ 1 - 0
spbase/sp_bcm.c

@@ -15,6 +15,7 @@
 #include "list.h"
 
 #include <winpr/synch.h>
+#include <winpr/string.h>
 
 #define BCM_CMD_MSG			0x01
 #define BCM_CMD_SUBSCRIBE	0x02

+ 2 - 0
spbase/sp_pst.c

@@ -7,6 +7,8 @@
 #include "strutil.h"
 #include "list.h"
 
+#include <winpr/string.h>
+
 struct sp_pst_tree_t {
 	sp_pst_elem_t *root;
 };

+ 6 - 1
spbase/sp_var.c

@@ -1,4 +1,3 @@
-#include <winpr/synch.h>
 #include "precompile.h"
 
 #include "sp_var.h"
@@ -15,6 +14,9 @@
 #include "refcnt.h"
 #include "iniutil.h"
 
+#include <winpr/synch.h>
+#include <winpr/string.h>
+
 #define VAR_CMD_CHANGE		0x01
 #define VAR_CMD_SUBSCRIBE	0x02
 #define VAR_CMD_UNSUBSCRIBE	0x03
@@ -292,12 +294,15 @@ int sp_var_listener_create(sp_svc_t *svc, const char *key, sp_var_on_change on_c
 	listener->key = _strdup(key);
 	listener->svc = svc;
 	*p_listener = listener;
+
+	sp_dbg_debug("create listener %llu for key %s (%llu)." , listener, listener->key, (void*)listener->key);
 	return 0;
 }
 
 static void __sp_var_listener_destroy(sp_var_listener_t *listener)
 {
 	strand_destroy(listener->strand);
+	sp_dbg_debug("free listener %llu for key %s (%llu).", listener, listener->key, (void*)listener->key);
 	free(listener->key);
 	free(listener);
 }