added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,44 @@
From c1e9f2f3d086e0df3c10a2468fd7b37fd0c5038c Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 7 Sep 2022 00:02:08 -0700
Subject: [PATCH] configure: Fix checks for system headers
Define _DEFAULT_SOURCE in system.c so unistd.h can expose readlink API
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
configure.ac | 2 +-
src/system.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index cdf1eba..6fc81e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -152,7 +152,7 @@ fi
dnl Checks for header files.
-AC_CHECK_HEADERS( [unistd.h, stdint.h, inttypes.h])
+AC_CHECK_HEADERS( [unistd.h stdint.h inttypes.h])
dnl Checks for typedefs, and compiler characteristics.
diff --git a/src/system.c b/src/system.c
index 4e008fa..98631a6 100644
--- a/src/system.c
+++ b/src/system.c
@@ -36,6 +36,8 @@
* 1. specify the constants in "configed.H" or "noconfig.H",
* 2. append the system-dependent routines in this file.
*/
+
+#define _DEFAULT_SOURCE
#if PREPROCESSED
#include "mcpp.H"
#else
--
2.37.3

View File

@@ -0,0 +1,34 @@
From ea453aca2742be6ac43ba4ce0da6f938a7e5a5d8 Mon Sep 17 00:00:00 2001
From: He Liu <liulonnie@gmail.com>
Date: Tue, 4 Feb 2014 11:00:40 -0800
Subject: [PATCH] line comment bug
---
src/support.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/support.c b/src/support.c
index c57eaef..e3357e4 100644
--- a/src/support.c
+++ b/src/support.c
@@ -188,7 +188,7 @@ static char * append_to_buffer(
size_t length
)
{
- if (mem_buf_p->bytes_avail < length) { /* Need to allocate more memory */
+ if (mem_buf_p->bytes_avail < length + 1) { /* Need to allocate more memory */
size_t size = MAX( BUF_INCR_SIZE, length);
if (mem_buf_p->buffer == NULL) { /* 1st append */
@@ -1722,6 +1722,8 @@ com_start:
sp -= 2;
while (*sp != '\n') /* Until end of line */
mcpp_fputc( *sp++, OUT);
+ mcpp_fputc('\n', OUT);
+ wrong_line = TRUE;
}
goto end_line;
default: /* Not a comment */
--
2.25.1

View File

@@ -0,0 +1,177 @@
diff -r -c -N ../mcpp-2.7.2-old/noconfig/vc2010.dif ./noconfig/vc2010.dif
*** ../mcpp-2.7.2-old/noconfig/vc2010.dif Wed Dec 31 20:30:00 1969
--- ./noconfig/vc2010.dif Fri May 14 12:47:22 2010
***************
*** 0 ****
--- 1,67 ----
+ *** noconfig.H Thu Sep 25 15:34:56 2008
+ --- noconfig.H.vc2005 Thu Sep 25 17:23:49 2008
+ ***************
+ *** 15,21 ****
+ */
+
+ /* Define target operating-system. */
+ ! #define SYSTEM SYS_FREEBSD
+
+ /* Define target compiler. */
+ #ifndef COMPILER
+ --- 15,21 ----
+ */
+
+ /* Define target operating-system. */
+ ! #define SYSTEM SYS_WIN32
+
+ /* Define target compiler. */
+ #ifndef COMPILER
+ ***************
+ *** 26,36 ****
+ #define HOST_SYSTEM SYSTEM
+
+ /* Define host compiler. */
+ ! #define HOST_COMPILER GNUC
+
+ /* Version message. */
+ /* "MCPP V.2.* (200y/mm) compiled by " precedes VERSION_MSG */
+ ! #define VERSION_MSG "GCC 3.4"
+ #if 0
+ "LCC-Win32 2006-03"
+ "Visual C 2005"
+ --- 26,36 ----
+ #define HOST_SYSTEM SYSTEM
+
+ /* Define host compiler. */
+ ! #define HOST_COMPILER MSC
+
+ /* Version message. */
+ /* "MCPP V.2.* (200y/mm) compiled by " precedes VERSION_MSG */
+ ! #define VERSION_MSG "Visual C 2010"
+ #if 0
+ "LCC-Win32 2006-03"
+ "Visual C 2005"
+ ***************
+ *** 212,221 ****
+ #define ONE_PASS TRUE
+ #endif
+ #define COMPILER_EXT "_MSC_VER"
+ ! #define COMPILER_EXT_VAL "1500" /* VC 6.0: "1200" */
+ /* VC 2002: "1300", VC 2003: "1310", VC 2005: "1400", VC 2008: "1500" */
+ #define COMPILER_EXT2 "_MSC_FULL_VER"
+ ! #define COMPILER_EXT2_VAL "150021022" /* VC 6.0: "12008804" */
+ /* VC 2002: "13009466", VC 2003: "13103077", VC 2005: "140050320" */
+ /* VC 2008: "150021022" */
+ #define COMPILER_SP1 "_MSC_EXTENSIONS"
+ --- 212,221 ----
+ #define ONE_PASS TRUE
+ #endif
+ #define COMPILER_EXT "_MSC_VER"
+ ! #define COMPILER_EXT_VAL "1600" /* VC 6.0: "1200" */
+ /* VC 2002: "1300", VC 2003: "1310", VC 2005: "1400", VC 2008: "1500" */
+ #define COMPILER_EXT2 "_MSC_FULL_VER"
+ ! #define COMPILER_EXT2_VAL "160030319" /* VC 6.0: "12008804" */
+ /* VC 2002: "13009466", VC 2003: "13103077", VC 2005: "140050320" */
+ /* VC 2008: "150021022" */
+ #define COMPILER_SP1 "_MSC_EXTENSIONS"
diff -r -c -N ../mcpp-2.7.2-old/src/internal.H ./src/internal.H
*** ../mcpp-2.7.2-old/src/internal.H Wed Aug 27 10:31:16 2008
--- ./src/internal.H Fri May 14 12:40:56 2010
***************
*** 390,395 ****
--- 390,397 ----
extern char identifier[]; /* Lastly scanned name */
extern IFINFO ifstack[]; /* Information of #if nesting */
extern char work_buf[];
+ extern FILEINFO * sh_file;
+ extern int sh_line;
/* Temporary buffer for directive line and macro expansion */
/* main.c */
***************
*** 557,562 ****
#endif
#endif
! #if HOST_HAVE_STPCPY
extern char * stpcpy( char * dest, const char * src);
#endif
--- 559,564 ----
#endif
#endif
! #if HOST_HAVE_STPCPY && !defined(stpcpy)
extern char * stpcpy( char * dest, const char * src);
#endif
diff -r -c -N ../mcpp-2.7.2-old/src/main.c ./src/main.c
*** ../mcpp-2.7.2-old/src/main.c Wed Nov 5 05:04:46 2008
--- ./src/main.c Fri May 14 12:40:56 2010
***************
*** 326,331 ****
--- 326,333 ----
= FALSE;
option_flags.trig = TRIGRAPHS_INIT;
option_flags.dig = DIGRAPHS_INIT;
+ sh_file = NULL;
+ sh_line = 0;
}
int mcpp_lib_main
diff -r -c -N ../mcpp-2.7.2-old/src/system.c ./src/system.c
*** ../mcpp-2.7.2-old/src/system.c 2008-11-26 10:53:51.000000000 +0100
--- ./src/system.c 2011-02-21 16:18:05.678058106 +0100
***************
*** 3534,3539 ****
--- 3534,3565 ----
FILEINFO * file;
const char * too_many_include_nest =
"More than %.0s%ld nesting of #include"; /* _F_ _W4_ */
+
+ //
+ // When encoding is UTF-8, skip BOM if present.
+ //
+ if(mbchar == UTF8 && fp != NULL && ftell(fp) == 0)
+ {
+ const unsigned char UTF8_BOM[3] = {0xEF, 0xBB, 0xBF};
+ unsigned char FILE_HEAD[3] = {0, 0, 0};
+ int i;
+ for(i = 0; i < 3; ++i)
+ {
+ FILE_HEAD[i] = getc(fp);
+ if(FILE_HEAD[i] != UTF8_BOM[i])
+ {
+ if(FILE_HEAD[i] == (unsigned char)EOF)
+ {
+ i--;
+ }
+ for(; i >= 0; --i)
+ {
+ ungetc(FILE_HEAD[i], fp);
+ }
+ break;
+ }
+ }
+ }
filename = set_fname( filename); /* Search or append to fnamelist[] */
fullname = set_fname( fullname); /* Search or append to fnamelist[] */
***************
*** 3858,3863 ****
--- 3884,3892 ----
}
#endif
+ FILEINFO* sh_file;
+ int sh_line;
+
void sharp(
FILEINFO * sharp_file,
int flag /* Flag to append to the line for GCC */
***************
*** 3868,3875 ****
* else (i.e. 'sharp_file' is NULL) 'infile'.
*/
{
- static FILEINFO * sh_file;
- static int sh_line;
FILEINFO * file;
int line;
--- 3897,3902 ----

View File

@@ -0,0 +1,18 @@
SUMMARY = "MCPP is a portable C/C++ preprocessor"
HOMEPAGE = "http://mcpp.sourceforge.net/"
LICENSE = "BSD-2-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=5ca370b75ec890321888a00cea9bc1d5"
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
file://ice-mcpp.patch \
file://0001-configure-Fix-checks-for-system-headers.patch \
file://CVE-2019-14274.patch"
SRC_URI[md5sum] = "512de48c87ab023a69250edc7a0c7b05"
SRC_URI[sha256sum] = "3b9b4421888519876c4fc68ade324a3bbd81ceeb7092ecdbbc2055099fcb8864"
inherit autotools
EXTRA_OECONF = " --enable-mcpplib "
BBCLASSEXTEND = "native nativesdk"