Selaa lähdekoodia

Move functions into the correct preprocessor branch

Kim Kulling 5 vuotta sitten
vanhempi
commit
435bba30dd
1 muutettua tiedostoa jossa 17 lisäystä ja 14 poistoa
  1. 17 14
      code/Common/DefaultIOStream.cpp

+ 17 - 14
code/Common/DefaultIOStream.cpp

@@ -5,8 +5,6 @@ Open Asset Import Library (assimp)
 
 Copyright (c) 2006-2020, assimp team
 
-
-
 All rights reserved.
 
 Redistribution and use of this software in source and binary forms,
@@ -52,27 +50,32 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 using namespace Assimp;
 
 namespace {
-template <size_t sizeOfPointer>
-size_t select_ftell(FILE *file) {
-    return ::ftell(file);
-}
-
-template <size_t sizeOfPointer>
-int select_fseek(FILE *file, int64_t offset, int origin) {
-    return ::fseek(file, static_cast<long>(offset), origin);
-}
 
 #if defined _WIN32 && (!defined __GNUC__ || __MSVCRT_VERSION__ >= 0x0601)
 template <>
-size_t select_ftell<8>(FILE *file) {
+inline size_t select_ftell<8>(FILE *file) {
     return (size_t)::_ftelli64(file);
 }
 
 template <>
-int select_fseek<8>(FILE *file, int64_t offset, int origin) {
+inline int select_fseek<8>(FILE *file, int64_t offset, int origin) {
     return ::_fseeki64(file, offset, origin);
 }
-#endif
+
+#else
+
+template <size_t sizeOfPointer>
+inline size_t select_ftell(FILE *file) {
+    return ::ftell(file);
+}
+
+template <size_t sizeOfPointer>
+inline int select_fseek(FILE *file, int64_t offset, int origin) {
+    return ::fseek(file, static_cast<long>(offset), origin);
+}
+
+#endif // #if defined _WIN32 && (!defined __GNUC__ || __MSVCRT_VERSION__ >= 0x0601)
+    
 } // namespace
 
 // ----------------------------------------------------------------------------------