Fix for "my libc doesn't have atoll" bug.

This commit is contained in:
Ron Pedde
2005-01-09 20:34:12 +00:00
parent 133e971edc
commit b8e421d8df
4 changed files with 35 additions and 1 deletions

View File

@@ -28,10 +28,11 @@ mt_daapd_SOURCES = main.c daapd.h rend.h uici.c uici.h webserver.c \
mp3-scanner.h mp3-scanner.c playlist.c playlist.h \
rend-unix.h lexer.l parser.y strcasestr.c strcasestr.h strsep.c \
redblack.c redblack.h dynamic-art.c dynamic-art.h query.c query.h \
atoll.c atoll.h \
$(PRENDSRC) $(ORENDSRC) $(HRENDSRC) $(OGGVORBISSRC)
EXTRA_DIST = mDNS.c mDNSClientAPI.h mDNSDebug.h mDNSPosix.c \
mDNSUNP.c mDNSPlatformFunctions.h mDNSPosix.h mDNSUNP.h \
rend-howl.c rend-posix.c rend-osx.c strcasestr.c strsep.c db-memory.c \
rend-howl.c rend-posix.c rend-osx.c db-memory.c \
db-gdbm.c strcasestr.h redblack.c redblack.h db-memory.c \
parser.h ogg.c

24
src/atoll.c Normal file
View File

@@ -0,0 +1,24 @@
/*
* $Id$
*
* The only platform I know without atoll is OSX 10.2, and it has
* 32 bit inodes, so this will be a fine workaround until such time
* as I move away from inodes as db index.
*
* Weak, I know.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#if !HAVE_ATOLL
long long atoll(const char *nptr) {
return (long long)atol(nptr);
}
#endif /* !HAVE_ATOLL */

7
src/atoll.h Normal file
View File

@@ -0,0 +1,7 @@
#ifndef _ATOLL_H_
#defien _ATOLL_H_
extern long long atoll(const char *nptr);
#endif /* _ATOLL_H_ */