Fixed an assortment of C++ and Haiku build errors.
This commit is contained in:
parent
5cfea3c0e0
commit
2a42511c5c
|
@ -15,6 +15,8 @@ CFLAGS += \
|
||||||
-Wno-switch \
|
-Wno-switch \
|
||||||
--std=c99
|
--std=c99
|
||||||
|
|
||||||
|
# TODO consider switching to C++11
|
||||||
|
# this will hopelessly disbar Haiku for GCC 2
|
||||||
CXXFLAGS += \
|
CXXFLAGS += \
|
||||||
-g \
|
-g \
|
||||||
-Wall -Wextra \
|
-Wall -Wextra \
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
// 6 april 2015
|
// 6 april 2015
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define uthash_fatal(msg) complain("uthash failed: %s", (msg))
|
#define uthash_fatal(msg) complain("uthash failed: %s", (msg))
|
||||||
|
@ -70,3 +74,7 @@ extern void fallbackScale(uiDrawMatrix *, double, double, double, double);
|
||||||
extern void fallbackMultiply(uiDrawMatrix *, uiDrawMatrix *);
|
extern void fallbackMultiply(uiDrawMatrix *, uiDrawMatrix *);
|
||||||
extern void fallbackTransformPoint(uiDrawMatrix *, double *, double *);
|
extern void fallbackTransformPoint(uiDrawMatrix *, double *, double *);
|
||||||
extern void fallbackTransformSize(uiDrawMatrix *, double *, double *);
|
extern void fallbackTransformSize(uiDrawMatrix *, double *, double *);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -16,7 +16,7 @@ CXXFLAGS += \
|
||||||
LDFLAGS += \
|
LDFLAGS += \
|
||||||
-fvisibility=hidden \
|
-fvisibility=hidden \
|
||||||
-fPIC \
|
-fPIC \
|
||||||
-lbe -lm
|
-lbe
|
||||||
|
|
||||||
# flags for warning on undefined symbols
|
# flags for warning on undefined symbols
|
||||||
LDFLAGS += \
|
LDFLAGS += \
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include "uipriv_haiku.hpp"
|
#include "uipriv_haiku.hpp"
|
||||||
using namepsace std;
|
using namespace std;
|
||||||
|
|
||||||
static set<void *> allocations;
|
static set<void *> allocations;
|
||||||
|
|
||||||
|
@ -48,23 +48,23 @@ void *uiAlloc(size_t size, const char *type)
|
||||||
return DATA(out);
|
return DATA(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *uiRealloc(void *p, size_t new, const char *type)
|
void *uiRealloc(void *p, size_t xnew, const char *type)
|
||||||
{
|
{
|
||||||
void *out;
|
void *out;
|
||||||
size_t *s;
|
size_t *s;
|
||||||
|
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
return uiAlloc(new, type);
|
return uiAlloc(xnew, type);
|
||||||
p = BASE(p);
|
p = BASE(p);
|
||||||
out = realloc(p, EXTRA + new);
|
out = realloc(p, EXTRA + xnew);
|
||||||
if (out == NULL) {
|
if (out == NULL) {
|
||||||
fprintf(stderr, "memory exhausted in uiRealloc()\n");
|
fprintf(stderr, "memory exhausted in uiRealloc()\n");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
s = SIZE(out);
|
s = SIZE(out);
|
||||||
if (new <= *s)
|
if (xnew <= *s)
|
||||||
memset(((uint8_t *) DATA(out)) + *s, 0, new - *s);
|
memset(((uint8_t *) DATA(out)) + *s, 0, xnew - *s);
|
||||||
*s = new;
|
*s = xnew;
|
||||||
// TODO check this
|
// TODO check this
|
||||||
allocations.erase(p);
|
allocations.erase(p);
|
||||||
allocations.insert(out);
|
allocations.insert(out);
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
// 17 november 2015
|
// 17 november 2015
|
||||||
// TODO versioning macros?
|
// TODO versioning macros?
|
||||||
|
#include <AppKit.h>
|
||||||
#include <InterfaceKit.h>
|
#include <InterfaceKit.h>
|
||||||
#include "../ui.h"
|
//TODO#include "../ui.h"
|
||||||
|
#include "ui.hpp"
|
||||||
#include "../ui_haiku.hpp"
|
#include "../ui_haiku.hpp"
|
||||||
#include "../common/uipriv.h"
|
#include "../common/uipriv.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue