summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon <simon@hardwired.org.uk>2010-11-06 17:42:22 (GMT)
committer Simon <simon@hardwired.org.uk>2010-11-06 17:42:22 (GMT)
commit43cbb294ef68683785b6f77826c76e40a0473410 (patch)
tree59d977271e0b8693b4bf8e0d2f14dd098e80a5c5
parentc5df30d90bc5591efa2e176dbd6fa405cf985c84 (diff)
downloadpowder-43cbb294ef68683785b6f77826c76e40a0473410.zip
powder-43cbb294ef68683785b6f77826c76e40a0473410.tar.gz
Visual Studio and MinGW comapatbility
-rw-r--r--includes/graphics.h6
-rw-r--r--includes/misc.h6
-rw-r--r--includes/powder.h10
-rw-r--r--src/graphics.c6
-rw-r--r--src/misc.c6
-rw-r--r--src/powder.c10
6 files changed, 22 insertions, 22 deletions
diff --git a/includes/graphics.h b/includes/graphics.h
index 7019351..e23fe9d 100644
--- a/includes/graphics.h
+++ b/includes/graphics.h
@@ -63,13 +63,13 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc);
void draw_menu(pixel *vid_buf, int i, int hover);
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
_inline void drawpixel(pixel *vid, int x, int y, int r, int g, int b, int a);
#else
extern inline void drawpixel(pixel *vid, int x, int y, int r, int g, int b, int a);
#endif
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
_inline int drawchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a);
#else
extern inline int drawchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a);
@@ -99,7 +99,7 @@ int textwidthx(char *s, int w);
int textposxy(char *s, int width, int w, int h);
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
_inline void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a);
#else
void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a);
diff --git a/includes/misc.h b/includes/misc.h
index 9a92a71..db3c2cb 100644
--- a/includes/misc.h
+++ b/includes/misc.h
@@ -21,19 +21,19 @@ __asm__ __volatile ("cpuid":\
static char hex[] = "0123456789ABCDEF";
//Signum function
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
extern _inline int isign(float i);
#else
extern inline int isign(float i);
#endif
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
extern _inline unsigned clamp_flt(float f, float min, float max);
#else
extern inline unsigned clamp_flt(float f, float min, float max);
#endif
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
extern _inline float restrict_flt(float f, float min, float max);
#else
extern inline float restrict_flt(float f, float min, float max);
diff --git a/includes/powder.h b/includes/powder.h
index 4f1f2ff..8f19d28 100644
--- a/includes/powder.h
+++ b/includes/powder.h
@@ -391,25 +391,25 @@ int try_move(int i, int x, int y, int nx, int ny);
void kill_part(int i);
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
extern _inline int create_part(int p, int x, int y, int t);
#else
extern inline int create_part(int p, int x, int y, int t);
#endif
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
extern _inline void delete_part(int x, int y);
#else
extern inline void delete_part(int x, int y);
#endif
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
extern _inline int is_wire(int x, int y);
#else
extern inline int is_wire(int x, int y);
#endif
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
extern _inline int is_wire_off(int x, int y);
#else
extern inline int is_wire_off(int x, int y);
@@ -417,7 +417,7 @@ extern inline int is_wire_off(int x, int y);
void set_emap(int x, int y);
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
_inline int parts_avg(int ci, int ni);
#else
int parts_avg(int ci, int ni);
diff --git a/src/graphics.c b/src/graphics.c
index f259a89..67a1324 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -757,7 +757,7 @@ void draw_menu(pixel *vid_buf, int i, int hover)
}
}
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
_inline void drawpixel(pixel *vid, int x, int y, int r, int g, int b, int a)
#else
inline void drawpixel(pixel *vid, int x, int y, int r, int g, int b, int a)
@@ -776,7 +776,7 @@ inline void drawpixel(pixel *vid, int x, int y, int r, int g, int b, int a)
vid[y*(XRES+BARSIZE)+x] = PIXRGB(r,g,b);
}
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
_inline int drawchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a)
#else
inline int drawchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a)
@@ -1054,7 +1054,7 @@ int textposxy(char *s, int width, int w, int h)
return n;
}
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
_inline void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a)
#else
inline void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a)
diff --git a/src/misc.c b/src/misc.c
index 7c551e2..e64fef7 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -7,7 +7,7 @@
#include "graphics.h"
//Signum function
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
_inline int isign(float i)
#else
inline int isign(float i)
@@ -20,7 +20,7 @@ inline int isign(float i)
return 0;
}
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
_inline unsigned clamp_flt(float f, float min, float max)
#else
inline unsigned clamp_flt(float f, float min, float max)
@@ -33,7 +33,7 @@ inline unsigned clamp_flt(float f, float min, float max)
return (int)(255.0f*(f-min)/(max-min));
}
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
_inline float restrict_flt(float f, float min, float max)
#else
inline float restrict_flt(float f, float min, float max)
diff --git a/src/powder.c b/src/powder.c
index c28129a..5e6851e 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -360,7 +360,7 @@ void kill_part(int i)
pfree = i;
}
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
_inline int create_part(int p, int x, int y, int t)
#else
inline int create_part(int p, int x, int y, int t)
@@ -656,7 +656,7 @@ static void create_cherenkov_photon(int pp)
parts[i].vy *= r;
}
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
_inline void delete_part(int x, int y)
#else
inline void delete_part(int x, int y)
@@ -674,7 +674,7 @@ inline void delete_part(int x, int y)
pmap[y][x] = 0; // just in case
}
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
_inline int is_wire(int x, int y)
#else
inline int is_wire(int x, int y)
@@ -683,7 +683,7 @@ inline int is_wire(int x, int y)
return bmap[y][x]==6 || bmap[y][x]==7 || bmap[y][x]==3 || bmap[y][x]==8 || bmap[y][x]==11 || bmap[y][x]==12;
}
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
_inline int is_wire_off(int x, int y)
#else
inline int is_wire_off(int x, int y)
@@ -774,7 +774,7 @@ void set_emap(int x, int y)
}
}
-#ifdef WIN32
+#if defined(WIN32) && !defined(__GNUC__)
_inline int parts_avg(int ci, int ni)
#else
inline int parts_avg(int ci, int ni)