summaryrefslogtreecommitdiffstats
path: root/tqtinterface/qt4/config.tests/unix/largefile
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-10 15:17:53 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-10 15:17:53 -0500
commitdda8474928bd7276e1fad8fb7a601e7c83ff2bc2 (patch)
tree7f83910598b33b12730035f086df20b5a53ab99c /tqtinterface/qt4/config.tests/unix/largefile
parent6260b6178868c03aab1644bf93b0ef043654bdb0 (diff)
downloadexperimental-dda8474928bd7276e1fad8fb7a601e7c83ff2bc2.tar.gz
experimental-dda8474928bd7276e1fad8fb7a601e7c83ff2bc2.zip
Added TQt4 HEAD
Diffstat (limited to 'tqtinterface/qt4/config.tests/unix/largefile')
-rw-r--r--tqtinterface/qt4/config.tests/unix/largefile/largefiletest.cpp32
-rw-r--r--tqtinterface/qt4/config.tests/unix/largefile/largefiletest.pro5
2 files changed, 37 insertions, 0 deletions
diff --git a/tqtinterface/qt4/config.tests/unix/largefile/largefiletest.cpp b/tqtinterface/qt4/config.tests/unix/largefile/largefiletest.cpp
new file mode 100644
index 0000000..ed04e7a
--- /dev/null
+++ b/tqtinterface/qt4/config.tests/unix/largefile/largefiletest.cpp
@@ -0,0 +1,32 @@
+/* Sample program for configure to test Large File support on target
+platforms.
+*/
+
+#define _LARGEFILE_SOURCE
+#define _LARGE_FILES
+#define _FILE_OFFSET_BITS 64
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <assert.h>
+#include <stdio.h>
+
+int main( int, char **argv )
+{
+// check that off_t can hold 2^63 - 1 and perform basic operations...
+#define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ if (OFF_T_64 % 2147483647 != 1)
+ return 1;
+
+ // stat breaks on SCO OpenServer
+ struct stat buf;
+ stat( argv[0], &buf );
+ if (!S_ISREG(buf.st_mode))
+ return 2;
+
+ FILE *file = fopen( argv[0], "r" );
+ off_t offset = ftello( file );
+ fseek( file, offset, SEEK_CUR );
+ fclose( file );
+ return 0;
+}
diff --git a/tqtinterface/qt4/config.tests/unix/largefile/largefiletest.pro b/tqtinterface/qt4/config.tests/unix/largefile/largefiletest.pro
new file mode 100644
index 0000000..918e8cc
--- /dev/null
+++ b/tqtinterface/qt4/config.tests/unix/largefile/largefiletest.pro
@@ -0,0 +1,5 @@
+TARGET=largefiletest
+CONFIG-=qt opengl x11sm dylib
+CONFIG+=console
+TEMPLATE=app
+SOURCES=largefiletest.cpp