Fixes that make Haiku build with gcc 4. Mainly out of the following
categories: * Missing includes (like <stdlib.h> and <string.h>). * Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so. * Local variables shadowing parameters. * Default parameters in function definitions (as opposed to function declarations). * All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported explicitly from the std:: namespace now. * "new (sometype)[...]" must read "new sometype[...]", even if sometype is something like "const char *". * __FUNCTION__ is no longer a string literal (but a string expression), i.e. 'printf(__FUNCTION__ ": ...\n")' is invalid code. * A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes" is an invalid expression. * "friend class SomeClass" only works when SomeClass is known before. Otherwise the an inner class with that name is considered as friend. gcc 4 is much pickier about scopes. * gcc 4 is generally stricter with respect to type conversions in C. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -812,8 +812,8 @@ arch_vm_translation_map_init_map(vm_translation_map *map, bool kernel)
|
||||
} else {
|
||||
// kernel
|
||||
// we already know the kernel pgdir mapping
|
||||
(addr_t)map->arch_data->pgdir_virt = kernel_pgdir_virt;
|
||||
(addr_t)map->arch_data->pgdir_phys = kernel_pgdir_phys;
|
||||
map->arch_data->pgdir_virt = kernel_pgdir_virt;
|
||||
map->arch_data->pgdir_phys = kernel_pgdir_phys;
|
||||
}
|
||||
|
||||
// zero out the bottom portion of the new pgdir
|
||||
|
||||
@@ -53,10 +53,10 @@ add_event_to_list(timer *event, timer * volatile *list)
|
||||
}
|
||||
|
||||
if (last != NULL) {
|
||||
(timer *)event->entry.next = (timer *)last->entry.next;
|
||||
(timer *)last->entry.next = event;
|
||||
event->entry.next = last->entry.next;
|
||||
last->entry.next = (qent*)event;
|
||||
} else {
|
||||
(timer *)event->entry.next = next;
|
||||
event->entry.next = (qent*)next;
|
||||
*list = event;
|
||||
}
|
||||
}
|
||||
@@ -182,7 +182,7 @@ _local_timer_cancel_event(int cpu, timer *event)
|
||||
if (current == sEvents[cpu])
|
||||
sEvents[cpu] = (timer *)current->entry.next;
|
||||
else
|
||||
(timer *)last->entry.next = (timer *)current->entry.next;
|
||||
last->entry.next = current->entry.next;
|
||||
current->entry.next = NULL;
|
||||
// break out of the whole thing
|
||||
break;
|
||||
@@ -234,7 +234,7 @@ cancel_timer(timer *event)
|
||||
if (current == sEvents[cpu])
|
||||
sEvents[cpu] = (timer *)current->entry.next;
|
||||
else
|
||||
(timer *)last->entry.next = (timer *)current->entry.next;
|
||||
last->entry.next = current->entry.next;
|
||||
current->entry.next = NULL;
|
||||
|
||||
// break out of the whole thing
|
||||
|
||||
@@ -54,6 +54,34 @@ fprintf(FILE *f, const char *format, ...)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
|
||||
extern "C"
|
||||
size_t
|
||||
fwrite(const void *buffer, size_t size, size_t numItems, FILE *stream)
|
||||
{
|
||||
dprintf("%.*s", int(size * numItems), (char*)buffer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
int
|
||||
fputs(const char *string, FILE *stream)
|
||||
{
|
||||
dprintf("%s", string);
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
int
|
||||
fputc(int c, FILE *stream)
|
||||
{
|
||||
dprintf("%c", c);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // __GNUC__ >= 3
|
||||
|
||||
extern "C"
|
||||
void
|
||||
abort()
|
||||
|
||||
Reference in New Issue
Block a user