use VIPS_PI instead of M_PI as the former is already defined, added missing includes with their macro protection

This commit is contained in:
Angel Sánchez 2018-05-31 13:50:50 +02:00
parent 86a1a0a7e2
commit 256cf494a3
7 changed files with 14 additions and 3 deletions

View File

@ -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 );

View File

@ -57,7 +57,9 @@
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <string.h>
#include <vips/vips.h>

View File

@ -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 )

View File

@ -87,6 +87,7 @@
#ifdef OS_WIN32
#include <windows.h>
#include <io.h>
#endif /*OS_WIN32*/
void *

View File

@ -59,7 +59,12 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_IO_H
#include <io.h>
#endif /*HAVE_IO_H*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>

View File

@ -48,6 +48,9 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /*HAVE_UNISTD_H*/
#ifdef HAVE_IO_H
#include <io.h>
#endif /*HAVE_IO_H*/
#include <fcntl.h>
#ifdef OS_WIN32

View File

@ -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];