diff --git a/libvips/create/perlin.c b/libvips/create/perlin.c index a6651f90..b0efdcc8 100644 --- a/libvips/create/perlin.c +++ b/libvips/create/perlin.c @@ -267,7 +267,7 @@ vips_perlin_make_tables( void *client ) int i; for( i = 0; i < 256; i++ ) { - double angle = 2 * M_PI * i / 256.0; + double angle = 2 * VIPS_PI * i / 256.0; vips_perlin_cos[i] = cos( angle ); vips_perlin_sin[i] = sin( angle ); diff --git a/libvips/foreign/rawsave.c b/libvips/foreign/rawsave.c index 63f4ded2..7b4bfafa 100644 --- a/libvips/foreign/rawsave.c +++ b/libvips/foreign/rawsave.c @@ -57,7 +57,9 @@ #include #include +#ifdef HAVE_UNISTD_H #include +#endif #include #include diff --git a/libvips/include/vips/util.h b/libvips/include/vips/util.h index f481e943..0d456c71 100644 --- a/libvips/include/vips/util.h +++ b/libvips/include/vips/util.h @@ -79,7 +79,7 @@ extern "C" { #define VIPS_ISINF( V ) isinf( V ) #define VIPS_FLOOR( V ) floor( V ) #define VIPS_CEIL( V ) ceil( V ) -#define VIPS_RINT( R ) rint( V ) +#define VIPS_RINT( V ) rint( V ) #define VIPS_ROUND( V ) round( V ) #define VIPS_FABS( V ) VIPS_ABS( V ) #define VIPS_FMAX( A, B ) VIPS_MAX( A, B ) diff --git a/libvips/iofuncs/mapfile.c b/libvips/iofuncs/mapfile.c index 37e1cf90..33911aac 100644 --- a/libvips/iofuncs/mapfile.c +++ b/libvips/iofuncs/mapfile.c @@ -87,6 +87,7 @@ #ifdef OS_WIN32 #include +#include #endif /*OS_WIN32*/ void * diff --git a/libvips/iofuncs/memory.c b/libvips/iofuncs/memory.c index 3bb7352e..d877e2e0 100644 --- a/libvips/iofuncs/memory.c +++ b/libvips/iofuncs/memory.c @@ -59,7 +59,12 @@ #include #include #include +#ifdef HAVE_UNISTD_H #include +#endif +#ifdef HAVE_IO_H +#include +#endif /*HAVE_IO_H*/ #include #include #include diff --git a/libvips/iofuncs/util.c b/libvips/iofuncs/util.c index c7026333..a9f3bb86 100644 --- a/libvips/iofuncs/util.c +++ b/libvips/iofuncs/util.c @@ -48,6 +48,9 @@ #ifdef HAVE_UNISTD_H #include #endif /*HAVE_UNISTD_H*/ +#ifdef HAVE_IO_H +#include +#endif /*HAVE_IO_H*/ #include #ifdef OS_WIN32 diff --git a/libvips/mosaicing/im_lrmerge.c b/libvips/mosaicing/im_lrmerge.c index 5ad06b0e..6512e2ae 100644 --- a/libvips/mosaicing/im_lrmerge.c +++ b/libvips/mosaicing/im_lrmerge.c @@ -165,7 +165,7 @@ im__make_blend_luts( void ) return( -1 ); for( x = 0; x < BLEND_SIZE; x++ ) { - double a = IM_PI * x / (BLEND_SIZE - 1.0); + double a = VIPS_PI * x / (BLEND_SIZE - 1.0); im__coef1[x] = (cos( a ) + 1.0) / 2.0; im__coef2[x] = 1.0 - im__coef1[x];