#ifdef _WIN32
#include <malloc.h>
#endif
+#if defined(__linux__) || defined(__APPLE__)
+#include <alloca.h>
+#endif
#include "../begin.h"
unsigned last_uses[2]; /**< bitset indicating last uses (input pos) */
ir_node *current_value; /**< copy of the value that should be used */
ir_node *original_value; /**< for copies point to original value */
- float prefs[0]; /**< register preferences */
+ float prefs[]; /**< register preferences */
};
typedef struct allocation_info_t allocation_info_t;
/** per basic-block information */
struct block_info_t {
bool processed; /**< indicate whether block is processed */
- ir_node *assignments[0]; /**< register assignments at end of block */
+ ir_node *assignments[]; /**< register assignments at end of block */
};
typedef struct block_info_t block_info_t;
typedef struct workset_t {
unsigned len; /**< current length */
- loc_t vals[0]; /**< array of the values/distances in this working set */
+ loc_t vals[]; /**< array of the values/distances in this working set */
} workset_t;
static struct obstack obst;
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock2.h>
+#include <BaseTsd.h>
+typedef SSIZE_T ssize_t;
#else
#include <unistd.h>
#include <sys/types.h>
return n;
}
-ssize_t lpp_flush(lpp_comm_t *comm)
+static ssize_t lpp_flush_(lpp_comm_t *comm)
{
ssize_t res = 0;
if(comm->w_pos - comm->w_buf > 0) {
return res;
}
+void lpp_flush(lpp_comm_t *comm)
+{
+ lpp_flush_(comm);
+}
+
static ssize_t lpp_write(lpp_comm_t *comm, const void *buf, size_t len)
{
assert(comm->w_pos - comm->w_buf >= 0);
size_t n_direct = rest / comm->buf_size;
size_t last_rest;
- if(lpp_flush(comm) < 0)
+ if(lpp_flush_(comm) < 0)
return -1;
for(i = 0; i < n_direct; ++i) {
#include <stdarg.h>
#include <stdint.h>
-#ifdef _WIN32
-#include <BaseTsd.h>
-typedef SSIZE_T ssize_t;
-#endif
-
#define LPP_PORT 2175
#define LPP_BUFSIZE (1 << 20)
int lpp_comm_fileno(const lpp_comm_t *comm);
-ssize_t lpp_flush(lpp_comm_t *comm);
+void lpp_flush(lpp_comm_t *comm);
void lpp_comm_free(lpp_comm_t *comm);
sin.sin_port = htons(port);
if ((phe = gethostbyname(host)))
- memcpy(&sin.sin_addr, phe->h_addr, phe->h_length);
+ memcpy(&sin.sin_addr, phe->h_addr_list[0], phe->h_length);
else if((sin.sin_addr.s_addr = inet_addr(host)) == INADDR_NONE) {
lpp_print_err("cannot get host entry for %s", host);
return -1;