site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=pdtL2Z0ELO8TEbHphihqbiKNMrTqTzWwOPLWV070ex8=; b=OhTzbFEpHE5tUz+B2lXkEl7R6em8lRp9cWOXg3xsGnhpIcdmjr+x0MSDaJtSeir+xu x8ePXU/uk7K3aPa/ZW7RQfWvXgz/0VLNSdR6wsVAtZjbD68f8LHQFM0yGFjdKYJ+iCIB 0bpLEplM30I3hGDXebCctEuNqlodR84SWoSp4= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=VBxU+ondoTkHkuS/v+U/1HPxVr5TkRfRmJgyBGGSRdU/GYDabxOmb75aV5TR7y8rfz MMCbkZHCjkS4vDSABk/RmojKgm3TE9Bl7cLP7V7wQtLy3kfQL74yr+YSW9D6JyXvxX/X 1xB4kVrpLNmefMf8e0M+dBnDvCTG4SdwDnz+Y= AFAIC where are no "fseeko64/fopen64" in C standard. For 64-bit offset, use int fseeko(FILE *stream, off_t offset, int whence); for definition of off_t, use #include <sys/types.h> You can read more in Mac OS X man pages. On Oct 23, 2010, at 2:28 PM, Alex Reynolds wrote:
I have a C application I am trying to compile under Mac OS X 10.6.4, which includes large file support. The application builds correctly under Linux.
Here is the Darwin kernel I am using:
------------------------- $ uname -v Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 -------------------------
My gcc installation is as follows:
------------------------- $ gcc --version i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664) -------------------------
My Makefile is as follows:
------------------------- CC=gcc CFLAGS=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -O3 -Wformat -Wall -pedantic -std=gnu99
all: myApp rm -rf *~
myApp: myApp.o ${CC} ${CFLAGS} myApp.o -lbz2 -o myApp rm -rf *~
clean: rm -rf *.o myApp -------------------------
The issue is that my application makes calls to "fseeko64" and "fopen64", and it uses the "off64_t" type for offsets. When I attempt to build, I get the following related warnings and errors:
------------------------- $ make myApp gcc -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -O3 -Wformat -Wall -pedantic -std=gnu99 -c -o myApp.o myApp.c myApp.c: In function ‘extractData’: myApp.c:119: warning: implicit declaration of function ‘fseeko64’ myApp.c:119: error: ‘off64_t’ undeclared (first use in this function) myApp.c:119: error: (Each undeclared identifier is reported only once myApp.c:119: error: for each function it appears in.) myApp.c: In function ‘extractMetadata’: myApp.c:305: warning: implicit declaration of function ‘fopen64’ myApp.c:305: warning: assignment makes pointer from integer without a cast -------------------------
My code builds without errors under Linux. What changes can I make to the source code to add large file support when building under Darwin?
Thanks for your advice.
Regards, Alex _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/rmuginov%40gmail.com
This email sent to rmuginov@gmail.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Rustam Muginov