Re: [Patches] Portability, support for CloudABI, etc.
Ed Schouten <[email protected]> Thu, 19 Nov 2015 11:12:45 +0100
| Newsgroups | gmane.comp.multimedia.matroska.devel |
|---|---|
| Message-ID | <CABh_MKnUxwKRkytDqwB3R3aRpEm0QmmAg=FEA8Ro_HvrhdUKSQ@mail.gmail.com> |
2015-11-18 22:53 GMT+01:00 Moritz Bunkus <[email protected]>: > Anyway, I don't really like that the two strings are removed from the > header files. No, that wouldn't break the ABI but the API, and I'd like > to keep both intact in order not to cause compilation failures. I have > no problems setting the string to "unknown" or something similar ("not > available"?) unconditionally, though, so that should keep both ABI and > API compatibility while gaining determinism. We want to preserve both the API and ABI. Got it! Attached are three new patches: - libebml: Rename config.h to ebml/ebml_config.h, add it to the installation target. Test for the presence of fopen(). Disable StdIOCallback's constructor in case fopen() is not present. As an alternative, do provide a constructor that allows you to pass in a FILE* directly. - libebml: Set EbmlCodeDate to "Unknown". Get rid of the local definition of __TIMESTAMP__. - libmatroska: Idem. Best regards, -- Ed Schouten <[email protected]> Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 _______________________________________________ Matroska-devel mailing list [email protected] http://lists.matroska.org/cgi-bin/mailman/listinfo/matroska-devel Read Matroska-Devel on GMane: http://dir.gmane.org/gmane.comp.multimedia.matroska.devel
libmatroska.diff
(text/plain, 527 B)
diff --git a/src/KaxVersion.cpp b/src/KaxVersion.cpp index edc99dc..b6b168a 100644 --- a/src/KaxVersion.cpp +++ b/src/KaxVersion.cpp @@ -38,6 +38,10 @@ START_LIBMATROSKA_NAMESPACE const std::string KaxCodeVersion = "1.4.4"; -const std::string KaxCodeDate = __TIMESTAMP__; + +// Up to version 1.4.4 this library exported a build date string. As +// this made the build non-reproducible, replace it by a placeholder to +// remain binary compatible. +const std::string KaxCodeDate = "Unknown"; END_LIBMATROSKA_NAMESPACE
libebml-timestamp.diff
(text/plain, 922 B)
diff --git a/ebml/EbmlConfig.h b/ebml/EbmlConfig.h index 9c96f33..5bb679f 100644 --- a/ebml/EbmlConfig.h +++ b/ebml/EbmlConfig.h @@ -111,11 +111,6 @@ # endif #endif -// For compilers that don't define __TIMESTAMP__ (e.g. gcc 2.95, gcc 3.2) -#ifndef __TIMESTAMP__ -#define __TIMESTAMP__ __DATE__ " " __TIME__ -#endif - #ifdef __GNUC__ #define EBML_PRETTYLONGINT(c) (c ## ll) #else // __GNUC__ diff --git a/src/EbmlVersion.cpp b/src/EbmlVersion.cpp index 375b702..62140b7 100644 --- a/src/EbmlVersion.cpp +++ b/src/EbmlVersion.cpp @@ -39,6 +39,10 @@ START_LIBEBML_NAMESPACE const std::string EbmlCodeVersion = "1.3.3"; -const std::string EbmlCodeDate = __TIMESTAMP__; + +// Up to version 1.3.3 this library exported a build date string. As +// this made the build non-reproducible, replace it by a placeholder to +// remain API compatible. +const std::string EbmlCodeDate = "Unknown"; END_LIBEBML_NAMESPACE
libebml-fopen.diff
(text/plain, 2.5 KB)
diff --git a/Makefile.am b/Makefile.am
index 9b10ee8..a7bd4e0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -66,6 +66,9 @@ nobase_include_HEADERS = \
ebml/SafeReadIOCallback.h \
ebml/StdIOCallback.h
+nobase_nodist_include_HEADERS = \
+ ebml/ebml_config.h
+
pkgconfigdir = ${libdir}/pkgconfig
pkgconfig_DATA = libebml.pc
diff --git a/configure.ac b/configure.ac
index 642978c..54eddcd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
AC_INIT([libebml], [1.3.3])
AC_CONFIG_AUX_DIR([build-aux])
-AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_HEADERS([ebml/ebml_config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign subdir-objects tar-pax])
AC_PROG_CXX
@@ -11,4 +11,5 @@ AC_ARG_ENABLE([debug],
AM_CONDITIONAL([ENABLE_DEBUG], [test "$enable_debug" = yes])
AC_CONFIG_FILES([Makefile libebml.pc])
AC_CHECK_HEADERS([winapifamily.h])
+AC_CHECK_FUNC(fopen, AC_DEFINE(HAVE_FOPEN, [], [fopen function is present]))
AC_OUTPUT
diff --git a/ebml/EbmlConfig.h b/ebml/EbmlConfig.h
index 9c96f33..336a0dd 100644
--- a/ebml/EbmlConfig.h
+++ b/ebml/EbmlConfig.h
@@ -36,9 +36,7 @@
#ifndef LIBEBML_CONFIG_H
#define LIBEBML_CONFIG_H
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include "ebml_config.h"
#if defined(__linux__)
#include <endian.h>
diff --git a/ebml/StdIOCallback.h b/ebml/StdIOCallback.h
index 65664b9..982f106 100644
--- a/ebml/StdIOCallback.h
+++ b/ebml/StdIOCallback.h
@@ -33,6 +33,7 @@
#ifndef LIBEBML_STDIOCALLBACK_H
#define LIBEBML_STDIOCALLBACK_H
+#include "EbmlConfig.h"
#include "IOCallback.h"
#include <stdexcept>
@@ -69,8 +70,10 @@ class EBML_DLL_API StdIOCallback:public IOCallback
uint64 mCurrentPosition;
public:
-// StdIOCallback(const char*Path,const char*Mode);
+ StdIOCallback(FILE*);
+#ifdef HAVE_FOPEN
StdIOCallback(const char*Path, const open_mode Mode);
+#endif
virtual ~StdIOCallback()throw();
virtual uint32 read(void*Buffer,size_t Size);
diff --git a/src/StdIOCallback.cpp b/src/StdIOCallback.cpp
index f697f9b..05df41c 100644
--- a/src/StdIOCallback.cpp
+++ b/src/StdIOCallback.cpp
@@ -60,6 +60,12 @@ CRTError::CRTError(const std::string & Description,int nError)
}
+StdIOCallback::StdIOCallback(FILE*Stream)
+ :File(Stream)
+{
+}
+
+#ifdef HAVE_FOPEN
StdIOCallback::StdIOCallback(const char*Path, const open_mode aMode)
{
assert(Path!=0);
@@ -92,6 +98,7 @@ StdIOCallback::StdIOCallback(const char*Path, const open_mode aMode)
}
mCurrentPosition = 0;
}
+#endif
StdIOCallback::~StdIOCallback()throw()