LibC: Some build fixes for strange platforms
Patch from Anonymous.
This commit is contained in:
parent
3900eebf15
commit
6d7854919a
Notes:
sideshowbarker
2024-07-19 11:52:58 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/6d7854919a9
4 changed files with 11 additions and 4 deletions
|
@ -6,20 +6,24 @@ extern "C" {
|
|||
int dlclose(void*)
|
||||
{
|
||||
ASSERT_NOT_REACHED();
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* dlerror()
|
||||
{
|
||||
ASSERT_NOT_REACHED();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void* dlopen(const char*, int)
|
||||
{
|
||||
ASSERT_NOT_REACHED();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void* dlsym(void*, const char*)
|
||||
{
|
||||
ASSERT_NOT_REACHED();
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,7 +146,7 @@ void* malloc(size_t size)
|
|||
LOCKER(malloc_lock());
|
||||
|
||||
if (s_log_malloc)
|
||||
dbgprintf("LibC: malloc(%u)\n", size);
|
||||
dbgprintf("LibC: malloc(%zu)\n", size);
|
||||
|
||||
if (!size)
|
||||
return nullptr;
|
||||
|
@ -190,13 +190,13 @@ void* malloc(size_t size)
|
|||
block->m_freelist = block->m_freelist->next;
|
||||
if (block->is_full()) {
|
||||
#ifdef MALLOC_DEBUG
|
||||
dbgprintf("Block %p is now full in size class %u\n", block, good_size);
|
||||
dbgprintf("Block %p is now full in size class %zu\n", block, good_size);
|
||||
#endif
|
||||
allocator->usable_blocks.remove(block);
|
||||
allocator->full_blocks.append(block);
|
||||
}
|
||||
#ifdef MALLOC_DEBUG
|
||||
dbgprintf("LibC: allocated %p (chunk in block %p, size %u)\n", ptr, block, block->bytes_per_chunk());
|
||||
dbgprintf("LibC: allocated %p (chunk in block %p, size %zu)\n", ptr, block, block->bytes_per_chunk());
|
||||
#endif
|
||||
if (s_scrub_malloc)
|
||||
memset(ptr, MALLOC_SCRUB_BYTE, block->m_size);
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
*/
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -60,7 +61,8 @@ static const char* determine_base(const char* p, int& base)
|
|||
static int _atob(unsigned long* vp, const char* p, int base)
|
||||
{
|
||||
unsigned long value, v1, v2;
|
||||
char *q, tmp[20];
|
||||
const char *q;
|
||||
char tmp[20];
|
||||
int digit;
|
||||
|
||||
if (p[0] == '0' && (p[1] == 'x' || p[1] == 'X')) {
|
||||
|
|
|
@ -8,5 +8,6 @@ long ulimit(int cmd, long newlimit)
|
|||
(void)cmd;
|
||||
(void)newlimit;
|
||||
ASSERT_NOT_REACHED();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue