Переглянути джерело

*** empty log message ***

David Rose 25 роки тому
батько
коміт
1db4b6f510
2 змінених файлів з 22 додано та 0 видалено
  1. 19 0
      panda/src/net/config_net.cxx
  2. 3 0
      panda/src/net/config_net.h

+ 19 - 0
panda/src/net/config_net.cxx

@@ -13,6 +13,25 @@ Configure(config_net);
 NotifyCategoryDef(net, "");
 
 ConfigureFn(config_net) {
+  init_libnet();
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: init_libnet
+//  Description: Initializes the library.  This must be called at
+//               least once before any of the functions or classes in
+//               this library can be used.  Normally it will be
+//               called by the static initializers and need not be
+//               called explicitly, but special cases exist.
+////////////////////////////////////////////////////////////////////
+void
+init_libnet() {
+  static bool initialized = false;
+  if (initialized) {
+    return;
+  }
+  initialized = true;
+
   NetDatagram::init_type();
 }
 

+ 3 - 0
panda/src/net/config_net.h

@@ -17,4 +17,7 @@ extern int get_net_max_write_queue();
 extern int get_net_max_response_queue();
 extern bool get_net_error_abort();
 
+extern EXPCL_PANDA void init_libnet();
+
 #endif
+