David Rose 16 роки тому
батько
коміт
8a9358adb3

+ 1 - 0
direct/src/plugin/Sources.pp

@@ -98,6 +98,7 @@
     load_plugin.cxx load_plugin.h \
     fileSpec.cxx fileSpec.h fileSpec.I \
     find_root_dir.cxx find_root_dir.h \
+    is_pathsep.h is_pathsep.I \
     mkdir_complete.cxx mkdir_complete.h
 
 #end static_lib_target

+ 33 - 0
direct/src/plugin/is_pathsep.I

@@ -0,0 +1,33 @@
+// Filename: is_pathsep.I
+// Created by:  drose (07Jul09)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) Carnegie Mellon University.  All rights reserved.
+//
+// All use of this software is subject to the terms of the revised BSD
+// license.  You should have received a copy of this license along
+// with this source code in a file named "LICENSE."
+//
+////////////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////////////
+//     Function: is_pathsep
+//  Description: Returns true if the indicated character is a path
+//               separator character (e.g. slash or backslash), false
+//               otherwise.
+////////////////////////////////////////////////////////////////////
+inline bool
+is_pathsep(char ch) {
+  if (ch == '/') {
+    return true;
+  }
+#ifdef _WIN32
+  if (ch == '\\') {
+    return true;
+  }
+#endif
+  return false;
+}

+ 23 - 0
direct/src/plugin/is_pathsep.h

@@ -0,0 +1,23 @@
+// Filename: is_pathsep.h
+// Created by:  drose (07Jul09)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) Carnegie Mellon University.  All rights reserved.
+//
+// All use of this software is subject to the terms of the revised BSD
+// license.  You should have received a copy of this license along
+// with this source code in a file named "LICENSE."
+//
+////////////////////////////////////////////////////////////////////
+
+#ifndef IS_PATHSEP_H
+#define IS_PATHSEP_H
+
+inline bool
+is_pathsep(char ch);
+
+#include "is_pathsep.I"
+
+#endif

+ 1 - 19
direct/src/plugin/load_plugin.cxx

@@ -14,6 +14,7 @@
 
 #include "load_plugin.h"
 #include "p3d_plugin_config.h"
+#include "is_pathsep.h"
 
 #include "assert.h"
 
@@ -74,25 +75,6 @@ get_plugin_basename() {
   return default_plugin_filename + dll_ext;
 }
 
-////////////////////////////////////////////////////////////////////
-//     Function: is_pathsep
-//  Description: Returns true if the indicated character is a path
-//               separator character (e.g. slash or backslash), false
-//               otherwise.
-////////////////////////////////////////////////////////////////////
-static inline bool
-is_pathsep(char ch) {
-  if (ch == '/') {
-    return true;
-  }
-#ifdef _WIN32
-  if (ch == '\\') {
-    return true;
-  }
-#endif
-  return false;
-}
-
 ////////////////////////////////////////////////////////////////////
 //     Function: find_extension_dot
 //  Description: Returns the position in the string of the dot before

+ 1 - 19
direct/src/plugin/mkdir_complete.cxx

@@ -13,6 +13,7 @@
 ////////////////////////////////////////////////////////////////////
 
 #include "mkdir_complete.h"
+#include "is_pathsep.h"
 
 #ifdef _WIN32
 #include <windows.h>
@@ -24,25 +25,6 @@
 
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: is_pathsep
-//  Description: Returns true if the indicated character is a path
-//               separator character (e.g. slash or backslash), false
-//               otherwise.
-////////////////////////////////////////////////////////////////////
-static inline bool
-is_pathsep(char ch) {
-  if (ch == '/') {
-    return true;
-  }
-#ifdef _WIN32
-  if (ch == '\\') {
-    return true;
-  }
-#endif
-  return false;
-}
-
 ////////////////////////////////////////////////////////////////////
 //     Function: get_dirname
 //  Description: Returns the directory component of the indicated