Commits

Wez Furlong  committed 022522f

move endian detection to configure.

  • Participants
  • Parent commits 27a4d40

Comments (0)

Files changed (4)

File configure.ac

 
 AC_SUBST(universal)
 
-AC_CONFIG_SRCDIR(src/AtomicParsley.cpp)
+AC_CONFIG_SRCDIR(src/parsley.cpp)
 AC_CONFIG_HEADER(src/config.h)
 
 AM_PROG_CC_C_O
   CXXFLAGS="$CXXFLAGS -Wall"
 fi
 AC_PROG_OBJC
+AC_C_BIGENDIAN
 
 AC_HEADER_DIRENT
 AC_HEADER_STDC

File src/AtomicParsley.h

    digest.  */
 extern void *sha1_buffer (const char *buffer, size_t len, void *resblock);
 
-void xmlInitEndianDetection();
-
 int isolat1ToUTF8(unsigned char* out, int outlen, const unsigned char* in, int inlen);
 int UTF8Toisolat1(unsigned char* out, int outlen, const unsigned char* in, int inlen);
 int UTF16BEToUTF8(unsigned char* out, int outlen, const unsigned char* inb, int inlenb);
 
 void printBOM();
 void APar_fprintf_UTF8_data(const char* utf8_encoded_data);
-#if defined (_MSC_VER)
 void APar_unicode_win32Printout(wchar_t* unicode_out, char* utf8_out);
-#endif
 
 void APar_Extract_uuid_binary_file(AtomicInfo* uuid_atom, const char* originating_file, char* output_path);
 void APar_Print_APuuid_atoms(const char *path, char* output_path, uint8_t target_information);
 uint32_t APar_4CC_CreatorCode(const char* filepath, uint32_t new_type_code);
 void APar_SupplySelectiveTypeCreatorCodes(const char *inputPath, const char *outputPath, uint8_t forced_type_code);
 
-#if defined (DARWIN_PLATFORM)
 bool ResizeGivenImage(const char* filePath, PicPrefs myPicPrefs, char* resized_path);
-#endif
 
 char* GenreIntToString(int genre);
 uint8_t StringGenreToInt(const char* genre_string);

File src/iconv.cpp

 
 // Original code for IsoLatin1 and UTF-16 by "Martin J. Duerst" <duerst@w3.org>
 
-static int xmlLittleEndian = 1;
-
-void xmlInitEndianDetection() {
-	unsigned short int tst = 0x1234;
-	unsigned char *ptr = (unsigned char *) &tst;
-
-	if (*ptr == 0x12) xmlLittleEndian = 0;
-    else if (*ptr == 0x34) xmlLittleEndian = 1;
-		
-	return;
-}
+static int xmlLittleEndian = 
+#ifdef WORDS_BIGENDIAN
+	0
+#else
+	1
+#endif
+	;
 
 /**
  * isolat1ToUTF8:

File src/main.cpp

 	char* ISObasemediafile = argv[1];
 	
 	TestFileExistence(ISObasemediafile, true);
-	xmlInitEndianDetection(); 
 	
 	char* padding_options = getenv("AP_PADDING");
 	ExtractPaddingPrefs(padding_options);