comparison include/SDL_stdinc.h @ 3012:7e30c2dc7783

Fixed Visual C++ release build for Visual C++ 2005 * Some math functions become intrinsic in release mode, so we need to convert all the math functions into SDL math functions, like we did with the stdlib functions. * Constant initializers of 8-bit values become calls to memset() in release mode, but memset() itself is an intrinsic when explicitly called. So we'll just explicitly call memset() in those cases.
author Sam Lantinga <slouken@libsdl.org>
date Sat, 10 Jan 2009 18:32:24 +0000
parents 99210400e8b9
children 77c3e67f0740
comparison
equal deleted inserted replaced
3011:8f4ed5ec2b06 3012:7e30c2dc7783
69 #elif defined(HAVE_STDINT_H) 69 #elif defined(HAVE_STDINT_H)
70 # include <stdint.h> 70 # include <stdint.h>
71 #endif 71 #endif
72 #ifdef HAVE_CTYPE_H 72 #ifdef HAVE_CTYPE_H
73 # include <ctype.h> 73 # include <ctype.h>
74 #endif
75 #ifdef HAVE_MATH_H
76 # include <math.h>
74 #endif 77 #endif
75 #ifdef HAVE_ICONV_H 78 #ifdef HAVE_ICONV_H
76 # include <iconv.h> 79 # include <iconv.h>
77 #endif 80 #endif
78 81
637 #else 640 #else
638 extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, 641 extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen,
639 const char *fmt, va_list ap); 642 const char *fmt, va_list ap);
640 #endif 643 #endif
641 644
645 #ifndef HAVE_M_PI
646 #define M_PI 3.14159265358979323846264338327950288 /* pi */
647 #endif
648
649 #ifdef HAVE_COPYSIGN
650 #define SDL_copysign copysign
651 #else
652 extern DECLSPEC double SDLCALL SDL_copysign(double x, double y);
653 #endif
654
655 #ifdef HAVE_COS
656 #define SDL_cos cos
657 #else
658 extern DECLSPEC double SDLCALL SDL_cos(double x);
659 #endif
660
661 #ifdef HAVE_COSF
662 #define SDL_cosf cosf
663 #else
664 #define SDL_cosf(x) (float)SDL_cos((double)x)
665 #endif
666
667 #ifdef HAVE_FABS
668 #define SDL_fabs fabs
669 #else
670 extern DECLSPEC double SDLCALL SDL_fabs(double x);
671 #endif
672
673 #ifdef HAVE_FLOOR
674 #define SDL_floor floor
675 #else
676 extern DECLSPEC double SDLCALL SDL_floor(double x);
677 #endif
678
679 #ifdef HAVE_LOG
680 #define SDL_log log
681 #else
682 extern DECLSPEC double SDLCALL SDL_log(double x);
683 #endif
684
685 #ifdef HAVE_POW
686 #define SDL_pow pow
687 #else
688 extern DECLSPEC double SDLCALL SDL_pow(double x, double y);
689 #endif
690
691 #ifdef HAVE_SCALBN
692 #define SDL_scalbn scalbn
693 #else
694 extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n);
695 #endif
696
697 #ifdef HAVE_SIN
698 #define SDL_sin sin
699 #else
700 extern DECLSPEC double SDLCALL SDL_sin(double x);
701 #endif
702
703 #ifdef HAVE_SINF
704 #define SDL_sinf sinf
705 #else
706 #define SDL_sinf(x) (float)SDL_sin((double)x)
707 #endif
708
709 #ifdef HAVE_SQRT
710 #define SDL_sqrt sqrt
711 #else
712 extern DECLSPEC double SDLCALL SDL_sqrt(double x);
713 #endif
714
642 /* The SDL implementation of iconv() returns these error codes */ 715 /* The SDL implementation of iconv() returns these error codes */
643 #define SDL_ICONV_ERROR (size_t)-1 716 #define SDL_ICONV_ERROR (size_t)-1
644 #define SDL_ICONV_E2BIG (size_t)-2 717 #define SDL_ICONV_E2BIG (size_t)-2
645 #define SDL_ICONV_EILSEQ (size_t)-3 718 #define SDL_ICONV_EILSEQ (size_t)-3
646 #define SDL_ICONV_EINVAL (size_t)-4 719 #define SDL_ICONV_EINVAL (size_t)-4