]> granicus.if.org Git - taglib/commitdiff
Remove CMake check for sizeof(long).
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Mon, 8 Dec 2014 23:55:46 +0000 (08:55 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Mon, 8 Dec 2014 23:55:46 +0000 (08:55 +0900)
ConfigureChecks.cmake
config.h.cmake
taglib/mp4/mp4atom.cpp

index cae533e382a7fe59a1ff132366cf698abf5011b2..99cc1de554148aadeccc346b1ace7fc3a04fbeda 100644 (file)
@@ -20,11 +20,6 @@ if(NOT ${SIZEOF_INT} EQUAL 4)
   MESSAGE(FATAL_ERROR "TagLib requires that int is 32-bit wide.")
 endif()
 
-check_type_size("long" SIZEOF_LONG)
-if(${SIZEOF_LONG} EQUAL 8)
-  set(LONG_IS_INT64 1)
-endif()
-
 check_type_size("long long" SIZEOF_LONGLONG)
 if(NOT ${SIZEOF_LONGLONG} EQUAL 8)
   MESSAGE(FATAL_ERROR "TagLib requires that long long is 64-bit wide.")
index abecfbfb514ca71f0448ccf51c5ae82362c17b00..07abffa667cba8fa9ea9f4441871c46792fb6e04 100644 (file)
@@ -8,9 +8,6 @@
 /* 1 if little-endian, 2 if big-endian. */
 #cmakedefine   FLOAT_BYTEORDER  ${FLOAT_BYTEORDER}
 
-/* Defined if long is 64-bit wide */
-#cmakedefine   LONG_IS_INT64    ${LONG_IS_INT64}
-
 /* Defined if your compiler supports some byte swap functions */
 #cmakedefine   HAVE_GCC_BYTESWAP_16 1
 #cmakedefine   HAVE_GCC_BYTESWAP_32 1
index 5a304e3f7557a2a093c05bf47958683de8c04b4b..b12f94599b50409fc45c14c053fea97915e1cd8a 100644 (file)
@@ -56,20 +56,21 @@ MP4::Atom::Atom(File *file)
 
   if(length == 1) {
     const long long longLength = file->readBlock(8).toLongLong();
-#ifdef LONG_IS_INT64
-    length = longLength;
-#else
-    if(longLength <= 0xFFFFFFFF) {
-        // The atom has a 64-bit length, but it's actually a 32-bit value
-        length = (long)longLength;
+    if(sizeof(long) == sizeof(long long)) {
+      length = longLength;
     }
     else {
+      if(longLength <= 0xFFFFFFFF) {
+        // The atom has a 64-bit length, but it's actually a 32-bit value
+        length = (long)longLength;
+      }
+      else {
         debug("MP4: 64-bit atoms are not supported");
         length = 0;
         file->seek(0, File::End);
         return;
+      }
     }
-#endif
   }
   if(length < 8) {
     debug("MP4: Invalid atom size");