summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFrantišek Dvořák <valtri@users.sourceforge.net>2006-04-08 16:42:23 +0000
committerFrantišek Dvořák <valtri@users.sourceforge.net>2006-04-08 16:42:23 +0000
commit8dc253dad613fa9408f0a0ccb674e9e77ddef767 (patch)
tree2d41848d2fd1c52032337315867352bce60f19eb /lib
parent6af6af590d98a8111bfc8dd498b11aecdbb3ecdd (diff)
downloadxine-lib-8dc253dad613fa9408f0a0ccb674e9e77ddef767.tar.gz
xine-lib-8dc253dad613fa9408f0a0ccb674e9e77ddef767.tar.bz2
Ancient platforms support:
- rint, lrint, M_PI (ffmpeg and goom) - avoid mkdir warnings - check for older _GUID_DEFINED too - ressurected generating inttypes, cleaned public os_types.h - moved function redefiniton used only in the old MSVC to central place Windows port update: - build internal ffmpeg: - workaround 'near' keyword problem - proper using __declspec(dllimport) Other changes: - LIBFFMPEG_CFLAGS --> LIBFFMPEG_CPPFLAGS CVS patchset: 7964 CVS date: 2006/04/08 16:42:23
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.am9
-rw-r--r--lib/os_internal.h57
-rw-r--r--lib/os_types.h16
3 files changed, 56 insertions, 26 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 5217afe55..37559c298 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,12 +1,15 @@
include $(top_srcdir)/misc/Makefile.common
+if GENERATED_INTTYPES_H
+inttypes_h = inttypes.h
+endif
+
EXTRA_DIST = Makefile.common
+CONFIG_CLEAN_FILES = $(inttypes_h)
noinst_LTLIBRARIES = libxineposix.la
-
noinst_HEADERS = os_internal.h
-
-include_HEADERS = os_types.h
+include_HEADERS = os_types.h $(inttypes_h)
libxineposix_la_SOURCES =
libxineposix_la_LIBADD = @LTLIBOBJS@
diff --git a/lib/os_internal.h b/lib/os_internal.h
index 67008c260..24ec8fe73 100644
--- a/lib/os_internal.h
+++ b/lib/os_internal.h
@@ -2,20 +2,21 @@
#define _XINE_OS_INTERNAL_H
#include <stddef.h>
-#include "os_types.h"
+#ifdef HOST_OS_DARWIN
+ /* Darwin (Mac OS X) needs __STDC_LIBRARY_SUPPORTED__ for SCNx64 and
+ * SCNxMAX macros */
+# ifndef __STDC_LIBRARY_SUPPORTED__
+# define __STDC_LIBRARY_SUPPORTED__
+# endif /* __STDC_LIBRARY_SUPPORTED__ */
+#endif
#if defined (__SVR4) && defined (__sun)
# include <sys/int_types.h>
-
-/* maybe needed for FreeBSD 4-STABLE */
-/*
-#elif defined (__FreeBSD__)
-# include <stdint.h>
-*/
-
#endif
+#include <inttypes.h>
+
#if defined(WIN32) || defined(__CYGWIN__)
# define XINE_PATH_SEPARATOR_STRING ";"
@@ -97,20 +98,39 @@ time_t _xine_private_timegm(struct tm *tm);
void _xine_private_unsetenv(const char *name);
#endif
-/* macross needed for MSVC */
-#ifdef _MSC_VER
+/* handle non-standard function names */
+#if !defined(HAVE_SNPRINTF) && defined(HAVE__SNPRINTF)
# define snprintf _snprintf
+#endif
+#if !defined(HAVE_VSNPRINTF) && defined(HAVE__VSNPRINTF)
# define vsnprintf _vsnprintf
+#endif
+#if !defined(HAVE_STRCASECMP) && defined(HAVE__STRICMP)
# define strcasecmp _stricmp
+#endif
+#if !defined(HAVE_STRNCASECMP) && defined(HAVE__STRNICMP)
# define strncasecmp _strnicmp
+#endif
+
+#include <math.h>
+#ifndef M_PI
# define M_PI 3.14159265358979323846
#endif
+#ifndef HAVE_LRINTF
+#define lrint(X) (long)((X) + ((X) >= 0 ? 0.5 : -0.5))
+#endif
+#ifndef HAVE_RINTF
+#define rint(X) (int)((X) + ((X) >= 0 ? 0.5 : -0.5))
+#endif
#ifdef WIN32
# include <io.h>
# ifdef _MSC_VER
# include <direct.h>
# endif
+# ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+# endif
# define mkdir(A, B) _mkdir((A))
# ifndef S_ISDIR
@@ -157,6 +177,23 @@ void _xine_private_unsetenv(const char *name);
# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
# endif
+/*
+ * workaround compatibility code due to 'near' and 'far' keywords in windef.h
+ * (do it only inside ffmpeg)
+ */
+# ifdef HAVE_AV_CONFIG_H
+# include <windef.h>
+# ifdef near
+# undef near
+# endif
+# ifdef far
+# undef far
+# endif
+ /* it sucks everywhere :-) */
+# define near win32_sucks_near
+# define far win32_sucks_far
+# endif /* av_config */
+
#endif
#ifndef HAVE_READLINK
diff --git a/lib/os_types.h b/lib/os_types.h
index 506a324bb..0cee183cc 100644
--- a/lib/os_types.h
+++ b/lib/os_types.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 the xine project
+ * Copyright (C) 2004-2006 the xine project
*
* This file is part of xine, a free video player.
*
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: os_types.h,v 1.4 2005/02/03 07:19:03 valtri Exp $ Ext
+ * $Id: os_types.h,v 1.5 2006/04/08 16:42:23 valtri Exp $ Ext
*
* Platform dependent types needed by public xine.h.
* Types not needed by xine.h are specified in os_internal.h.
@@ -97,22 +97,12 @@
typedef long int64_t;
typedef unsigned long int64_t;
-#elif defined(HOST_OS_DARWIN)
-
- /* Darwin (Mac OS X) needs __STDC_LIBRARY_SUPPORTED__ for SCNx64 and
- * SCNxMAX macros */
-# ifndef __STDC_LIBRARY_SUPPORTED__
-# define __STDC_LIBRARY_SUPPORTED__
-# endif /* __STDC_LIBRARY_SUPPORTED__ */
-
-# include <inttypes.h>
-
#else
/*
* CygWin: _WIN32 & __GNUC__
* BeOS: __BEOS__
- * Linux, Solaris and others
+ * Linux, Solaris, Mac and others
*/
# include <inttypes.h>