mcst-linux-kernel/patches-2024.06.26/mongodb-3.6.13/0007-Fix-bug-139275.patch

156 lines
6.5 KiB
Diff
Raw Normal View History

2024-07-09 13:51:45 +03:00
Link:
Subject: temporary solution errors of build with lcc-1.26.10
Bug: 139275
Tags: lcc
--- a/src/third_party/mozjs-45/extract/mfbt/lz4.c 2022-02-24 16:48:57.658819806 +0300
+++ b/src/third_party/mozjs-45/extract/mfbt/lz4.c 2022-02-24 16:47:53.014180817 +0300
@@ -366,7 +366,7 @@
/********************************
Compression functions
********************************/
-int LZ4_compressBound(int isize) { return LZ4_COMPRESSBOUND(isize); }
+extern "C" int LZ4_compressBound(int isize) { return LZ4_COMPRESSBOUND(isize); }
static int LZ4_hashSequence(U32 sequence, tableType_t tableType)
{
@@ -640,7 +640,7 @@
}
-int LZ4_compress(const char* source, char* dest, int inputSize)
+extern "C" int LZ4_compress(const char* source, char* dest, int inputSize)
{
#if (HEAPMODE)
void* ctx = ALLOCATOR(LZ4_STREAMSIZE_U32, 4); /* Aligned on 4-bytes boundaries */
@@ -660,7 +660,7 @@
return result;
}
-int LZ4_compress_limitedOutput(const char* source, char* dest, int inputSize, int maxOutputSize)
+extern "C" int LZ4_compress_limitedOutput(const char* source, char* dest, int inputSize, int maxOutputSize)
{
#if (HEAPMODE)
void* ctx = ALLOCATOR(LZ4_STREAMSIZE_U32, 4); /* Aligned on 4-bytes boundaries */
@@ -685,21 +685,21 @@
Experimental : Streaming functions
*****************************************/
-void* LZ4_createStream()
+extern "C" void* LZ4_createStream()
{
void* lz4s = ALLOCATOR(4, LZ4_STREAMSIZE_U32);
MEM_INIT(lz4s, 0, LZ4_STREAMSIZE);
return lz4s;
}
-int LZ4_free (void* LZ4_stream)
+extern "C" int LZ4_free (void* LZ4_stream)
{
FREEMEM(LZ4_stream);
return (0);
}
-int LZ4_loadDict (void* LZ4_dict, const char* dictionary, int dictSize)
+extern "C" int LZ4_loadDict (void* LZ4_dict, const char* dictionary, int dictSize)
{
LZ4_stream_t_internal* dict = (LZ4_stream_t_internal*) LZ4_dict;
const BYTE* p = (const BYTE*)dictionary;
@@ -804,12 +804,12 @@
}
-int LZ4_compress_continue (void* LZ4_stream, const char* source, char* dest, int inputSize)
+extern "C" int LZ4_compress_continue (void* LZ4_stream, const char* source, char* dest, int inputSize)
{
return LZ4_compress_continue_generic(LZ4_stream, source, dest, inputSize, 0, notLimited);
}
-int LZ4_compress_limitedOutput_continue (void* LZ4_stream, const char* source, char* dest, int inputSize, int maxOutputSize)
+extern "C" int LZ4_compress_limitedOutput_continue (void* LZ4_stream, const char* source, char* dest, int inputSize, int maxOutputSize)
{
return LZ4_compress_continue_generic(LZ4_stream, source, dest, inputSize, maxOutputSize, limitedOutput);
}
@@ -836,7 +836,7 @@
}
-int LZ4_saveDict (void* LZ4_dict, char* safeBuffer, int dictSize)
+extern "C" int LZ4_saveDict (void* LZ4_dict, char* safeBuffer, int dictSize)
{
LZ4_stream_t_internal* dict = (LZ4_stream_t_internal*) LZ4_dict;
const BYTE* previousDictEnd = dict->dictionary + dict->dictSize;
@@ -1044,17 +1044,17 @@
}
-int LZ4_decompress_safe(const char* source, char* dest, int compressedSize, int maxOutputSize)
+extern "C" int LZ4_decompress_safe(const char* source, char* dest, int compressedSize, int maxOutputSize)
{
return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize, endOnInputSize, full, 0, noDict, NULL, 0);
}
-int LZ4_decompress_safe_partial(const char* source, char* dest, int compressedSize, int targetOutputSize, int maxOutputSize)
+extern "C" int LZ4_decompress_safe_partial(const char* source, char* dest, int compressedSize, int targetOutputSize, int maxOutputSize)
{
return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize, endOnInputSize, partial, targetOutputSize, noDict, NULL, 0);
}
-int LZ4_decompress_fast(const char* source, char* dest, int originalSize)
+extern "C" int LZ4_decompress_fast(const char* source, char* dest, int originalSize)
{
return LZ4_decompress_generic(source, dest, 0, originalSize, endOnOutputSize, full, 0, withPrefix64k, NULL, 0);
}
@@ -1075,7 +1075,7 @@
* LZ4_createStreamDecode()
* provides a pointer (void*) towards an initialized LZ4_streamDecode_t structure.
*/
-void* LZ4_createStreamDecode()
+extern "C" void* LZ4_createStreamDecode()
{
void* lz4s = ALLOCATOR(sizeof(U32), LZ4_STREAMDECODESIZE_U32);
MEM_INIT(lz4s, 0, LZ4_STREAMDECODESIZE);
@@ -1089,7 +1089,7 @@
* Loading a size of 0 is allowed (same effect as no dictionary).
* Return : 1 if OK, 0 if error
*/
-int LZ4_setDictDecode (void* LZ4_streamDecode, const char* dictionary, int dictSize)
+extern "C" int LZ4_setDictDecode (void* LZ4_streamDecode, const char* dictionary, int dictSize)
{
LZ4_streamDecode_t_internal* lz4sd = (LZ4_streamDecode_t_internal*) LZ4_streamDecode;
lz4sd->dictionary = dictionary;
@@ -1104,7 +1104,7 @@
If it's not possible, save the relevant part of decoded data into a safe buffer,
and indicate where it stands using LZ4_setDictDecode()
*/
-int LZ4_decompress_safe_continue (void* LZ4_streamDecode, const char* source, char* dest, int compressedSize, int maxOutputSize)
+extern "C" int LZ4_decompress_safe_continue (void* LZ4_streamDecode, const char* source, char* dest, int compressedSize, int maxOutputSize)
{
LZ4_streamDecode_t_internal* lz4sd = (LZ4_streamDecode_t_internal*) LZ4_streamDecode;
int result;
@@ -1124,7 +1124,7 @@
return result;
}
-int LZ4_decompress_fast_continue (void* LZ4_streamDecode, const char* source, char* dest, int originalSize)
+extern "C" int LZ4_decompress_fast_continue (void* LZ4_streamDecode, const char* source, char* dest, int originalSize)
{
LZ4_streamDecode_t_internal* lz4sd = (LZ4_streamDecode_t_internal*) LZ4_streamDecode;
int result;
@@ -1152,12 +1152,12 @@
the dictionary must be explicitly provided within parameters
*/
-int LZ4_decompress_safe_usingDict(const char* source, char* dest, int compressedSize, int maxOutputSize, const char* dictStart, int dictSize)
+extern "C" int LZ4_decompress_safe_usingDict(const char* source, char* dest, int compressedSize, int maxOutputSize, const char* dictStart, int dictSize)
{
return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize, endOnInputSize, full, 0, usingExtDict, dictStart, dictSize);
}
-int LZ4_decompress_fast_usingDict(const char* source, char* dest, int originalSize, const char* dictStart, int dictSize)
+extern "C" int LZ4_decompress_fast_usingDict(const char* source, char* dest, int originalSize, const char* dictStart, int dictSize)
{
return LZ4_decompress_generic(source, dest, 0, originalSize, endOnOutputSize, full, 0, usingExtDict, dictStart, dictSize);
}