Skip to content
Snippets Groups Projects
Commit 50dd5604 authored by slevy's avatar slevy
Browse files

Avoid collision with Windows' htonl() which might or might not exist --

just define our own.
parent 779a2ad9
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,8 @@
#include "config.h"
#include "winjunk.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
......@@ -65,15 +67,18 @@ int random() {
}
/* Assuming x86 Windows, i.e. little-endian */
unsigned int htonl(unsigned int v) {
/* We already have this defined -- no, we don't */
unsigned int my_htonl(unsigned int v) {
return (v&0xFF)<<24 | (v&0xFF00)<<8 | (v>>8)&0xFF00 | (v>>24)&0xFF;
}
unsigned int my_ntohl(unsigned int v) {
return (v&0xFF)<<24 | (v&0xFF00)<<8 | (v>>8)&0xFF00 | (v>>24)&0xFF;
}
#include <math.h>
#include <float.h>
#ifndef HAVE_RINT
#if !defined(AR_USE_MINGW) // was !defined(HAVE_RINT)
double rint(double v) {
return floor(v + 0.5);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment