Compare commits
2 Commits
Author | SHA256 | Date | |
---|---|---|---|
840fca5595 | |||
37c507a6e0 |
@@ -1,6 +1,7 @@
|
||||
diff -ru mcpp-2.7.2.orig//src/system.c mcpp-2.7.2/src/system.c
|
||||
--- mcpp-2.7.2.orig//src/system.c 2008-11-26 10:53:51.000000000 +0100
|
||||
+++ mcpp-2.7.2/src/system.c 2009-02-06 10:12:29.000000000 +0100
|
||||
Index: mcpp-2.7.2.1/src/system.c
|
||||
===================================================================
|
||||
--- mcpp-2.7.2.1.orig/src/system.c
|
||||
+++ mcpp-2.7.2.1/src/system.c
|
||||
@@ -43,6 +43,8 @@
|
||||
#include "internal.H"
|
||||
#endif
|
||||
@@ -10,3 +11,17 @@ diff -ru mcpp-2.7.2.orig//src/system.c mcpp-2.7.2/src/system.c
|
||||
#if HOST_SYS_FAMILY == SYS_UNIX
|
||||
#include "unistd.h" /* For getcwd(), readlink() */
|
||||
#elif HOST_COMPILER == MSC || HOST_COMPILER == LCC
|
||||
Index: mcpp-2.7.2.1/src/expand.c
|
||||
===================================================================
|
||||
--- mcpp-2.7.2.1.orig/src/expand.c
|
||||
+++ mcpp-2.7.2.1/src/expand.c
|
||||
@@ -710,7 +710,8 @@ static char * replace(
|
||||
} else {
|
||||
m_inf->locs.start_col = m_inf->locs.start_line = 0L;
|
||||
}
|
||||
- m_inf->args = m_inf->loc_args = NULL; /* Default args */
|
||||
+ m_inf->args = NULL; /* Default args */
|
||||
+ m_inf->loc_args = NULL;
|
||||
for (num = 1, recurs = 0; num < m_num; num++)
|
||||
if (mac_inf[ num].defp == defp)
|
||||
recurs++; /* Recursively nested macro */
|
||||
|
59
mcpp-c99.patch
Normal file
59
mcpp-c99.patch
Normal file
@@ -0,0 +1,59 @@
|
||||
Do not define and undefine _*_SOURCE macros. These have special
|
||||
semantics to glibc. <limits.h> may include <features.h>, and which
|
||||
point the feature configuration gets frozen. Without this change,
|
||||
when system.c includes <unistd.h>, the feature macros are hard-coded
|
||||
as baseline POSIX, which does not include readlink. This will lead to
|
||||
compilation errors with future compilers.
|
||||
|
||||
Submitted upstream: <https://sourceforge.net/p/mcpp/patches/7/>
|
||||
|
||||
diff --git a/src/configed.H b/src/configed.H
|
||||
index b4d1ebf3a6bfa280..bde16fc8db38a2c4 100644
|
||||
--- a/src/configed.H
|
||||
+++ b/src/configed.H
|
||||
@@ -295,20 +295,7 @@
|
||||
* ULONGMAX should be defined to the ULONG_MAX in <limits.h>.
|
||||
*/
|
||||
|
||||
-/* _POSIX_* only to get PATH_MAX */
|
||||
-#define _POSIX_ 1
|
||||
-#define _POSIX_SOURCE 1
|
||||
-#ifndef _POSIX_C_SOURCE
|
||||
-#define _POSIX_C_SOURCE 1
|
||||
-#define _POSIX_C_SOURCE_defined 1
|
||||
-#endif
|
||||
#include "limits.h"
|
||||
-#undef _POSIX_
|
||||
-#undef _POSIX_SOURCE
|
||||
-#ifdef _POSIX_C_SOURCE_defined
|
||||
-#undef _POSIX_C_SOURCE
|
||||
-#undef _POSIX_C_SOURCE_defined
|
||||
-#endif
|
||||
#define CHARBIT CHAR_BIT
|
||||
#define UCHARMAX UCHAR_MAX
|
||||
#define USHRTMAX USHRT_MAX
|
||||
diff --git a/src/noconfig.H b/src/noconfig.H
|
||||
index 6b634fe0b32ff67c..7c923c900c8865dd 100644
|
||||
--- a/src/noconfig.H
|
||||
+++ b/src/noconfig.H
|
||||
@@ -570,20 +570,7 @@
|
||||
#include "stdio.h"
|
||||
|
||||
/* PATHMAX is the maximum length of path-list on the host system. */
|
||||
-/* _POSIX_* only to get PATH_MAX */
|
||||
-#define _POSIX_ 1
|
||||
-#define _POSIX_SOURCE 1
|
||||
-#ifndef _POSIX_C_SOURCE
|
||||
-#define _POSIX_C_SOURCE 1
|
||||
-#define _POSIX_C_SOURCE_defined 1
|
||||
-#endif
|
||||
#include "limits.h"
|
||||
-#undef _POSIX_
|
||||
-#undef _POSIX_SOURCE
|
||||
-#ifdef _POSIX_C_SOURCE_defined
|
||||
-#undef _POSIX_C_SOURCE
|
||||
-#undef _POSIX_C_SOURCE_defined
|
||||
-#endif
|
||||
#ifdef PATH_MAX
|
||||
#define PATHMAX PATH_MAX /* Posix macro */
|
||||
#else
|
@@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 23 08:27:43 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- refresh mcpp-2.7.2.1.diff, add mcpp-c99.patch: Gcc 14+ build
|
||||
fixes
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Dec 31 09:45:08 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package mcpp
|
||||
#
|
||||
# Copyright (c) 2023 SUSE LLC
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -25,6 +25,7 @@ Group: Development/Languages/C and C++
|
||||
URL: https://mcpp.sourceforge.net/
|
||||
Source0: https://github.com/museoa/mcpp/archive/refs/tags/%{version}.tar.gz
|
||||
Patch0: %{name}-2.7.2.1.diff
|
||||
Patch1: mcpp-c99.patch
|
||||
|
||||
%description
|
||||
mcpp is a small and portable C/C++ preprocessor implementing all of
|
||||
@@ -67,8 +68,7 @@ export CFLAGS="%{optflags} -D_BSD_SOURCE"
|
||||
rm -rf %{buildroot}%{_datadir}/doc/mcpp
|
||||
rm -rf %{buildroot}%{_libdir}/libmcpp.*a
|
||||
|
||||
%post -n %{_libname} -p /sbin/ldconfig
|
||||
%postun -n %{_libname} -p /sbin/ldconfig
|
||||
%ldconfig_scriptlets -n %{_libname}
|
||||
|
||||
%files
|
||||
%license LICENSE
|
||||
|
Reference in New Issue
Block a user