Lots of little fixes for doing MSVC compiling codecs in windows (#6022)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@9450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Matthew Fredrickson
2006-02-10 23:37:27 +00:00
parent c344781c4b
commit 4f803dfda0
24 changed files with 992 additions and 80 deletions

View File

@@ -136,6 +136,11 @@ static __inline__ short GSM_SUB(short a, short b)
#else
#ifdef WIN32
#define inline __inline
#define __inline__ __inline
#endif
# define GSM_L_ADD(a, b) \
( (a) < 0 ? ( (b) >= 0 ? (a) + (b) \
: (utmp = (ulongword)-((a) + 1) + (ulongword)-((b) + 1)) \
@@ -144,25 +149,19 @@ static __inline__ short GSM_SUB(short a, short b)
: (utmp = (ulongword)(a) + (ulongword)(b)) >= MAX_LONGWORD \
? MAX_LONGWORD : utmp))
/*
* # define GSM_ADD(a, b) \
* ((ltmp = (longword)(a) + (longword)(b)) >= MAX_WORD \
* ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp)
*/
/* Nonportable, but faster: */
static inline word GSM_ADD(a, b)
{
register longword ltmp;
ltmp = (longword) (a) + (longword) (b);
return (word)((ulongword) (ltmp - MIN_WORD) > MAX_WORD - MIN_WORD ? (ltmp > 0 ? MAX_WORD : MIN_WORD) : ltmp);
};
# define GSM_ADD(a, b) ({ \
register longword ltmp; \
ltmp = (longword) (a) + (longword) (b); \
((ulongword) (ltmp - MIN_WORD) > MAX_WORD - MIN_WORD ? \
(ltmp > 0 ? MAX_WORD : MIN_WORD) : ltmp); \
})
#define GSM_SUB(a, b) ({ \
register longword ltmp; \
ltmp = (longword) (a) - (longword) (b); \
(ltmp >= MAX_WORD ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp); \
})
static inline word GSM_SUB(a, b)
{
register longword ltmp;
ltmp = (longword) (a) - (longword) (b);
return (word)(ltmp >= MAX_WORD ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp);
};
#endif