From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29895 invoked by alias); 28 Jan 2009 14:46:42 -0000 Received: (qmail 29886 invoked by uid 22791); 28 Jan 2009 14:46:40 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from hagrid.ecoscentric.com (HELO mail.ecoscentric.com) (212.13.207.197) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 28 Jan 2009 14:46:34 +0000 Received: from localhost (hagrid.ecoscentric.com [127.0.0.1]) by mail.ecoscentric.com (Postfix) with ESMTP id 3080560B8009 for ; Wed, 28 Jan 2009 14:46:32 +0000 (GMT) Received: from mail.ecoscentric.com ([127.0.0.1]) by localhost (hagrid.ecoscentric.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IMtn+88CISLX; Wed, 28 Jan 2009 14:46:30 +0000 (GMT) Received: (from bartv@localhost) by hermione.bartv.net (8.14.3/8.14.3/Submit) id n0SEkSJe031158; Wed, 28 Jan 2009 14:46:28 GMT Date: Wed, 28 Jan 2009 14:46:00 -0000 Message-Id: <200901281446.n0SEkSJe031158@hermione.bartv.net> From: Bart Veer To: ecos-patches@sourceware.org Subject: and more main() fixes Mailing-List: contact ecos-patches-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-patches-owner@ecos.sourceware.org X-SW-Source: 2009-01/txt/msg00028.txt.bz2 This patch fixes up the tests in language/c/libc/stdlib to cope with configurations that do not use main(). Bart 2009-01-26 Jonathan Larmour * tests/abs.c: Allow to run if CYGPKG_LIBC_STARTUP isn't there. * tests/atoi.c: Ditto. * tests/atol.c: Ditto. * tests/bsearch.c: Ditto. * tests/div.c: Ditto. * tests/getenv.c: Ditto. * tests/labs.c: Ditto. * tests/ldiv.c: Ditto. * tests/qsort.c: Ditto. * tests/rand1.c: Ditto. * tests/rand2.c: Ditto. * tests/rand3.c: Ditto. * tests/rand4.c: Ditto. * tests/srand.c: Ditto. * tests/strtol.c: Ditto. * tests/strtoul.c: Ditto. Index: tests/abs.c =================================================================== RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdlib/current/tests/abs.c,v retrieving revision 1.3 diff -u -p -r1.3 abs.c --- tests/abs.c 23 May 2002 23:07:22 -0000 1.3 +++ tests/abs.c 28 Jan 2009 14:45:34 -0000 @@ -49,15 +49,19 @@ //####DESCRIPTIONEND#### // INCLUDES - +#include #include #include #include // FUNCTIONS +#ifndef CYGPKG_LIBC_STARTUP +void cyg_user_start(void) +#else int main( int argc, char *argv[] ) +#endif { int x; Index: tests/atoi.c =================================================================== RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdlib/current/tests/atoi.c,v retrieving revision 1.4 diff -u -p -r1.4 atoi.c --- tests/atoi.c 23 May 2002 23:07:22 -0000 1.4 +++ tests/atoi.c 28 Jan 2009 14:45:34 -0000 @@ -50,6 +50,7 @@ // INCLUDES +#include #include #include @@ -94,8 +95,12 @@ test( CYG_ADDRWORD data ) } // test() +#ifndef CYGPKG_LIBC_STARTUP +void cyg_user_start(void) +#else int -main(int argc, char *argv[]) +main( int argc, char *argv[] ) +#endif { CYG_TEST_INIT(); Index: tests/atol.c =================================================================== RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdlib/current/tests/atol.c,v retrieving revision 1.3 diff -u -p -r1.3 atol.c --- tests/atol.c 23 May 2002 23:07:22 -0000 1.3 +++ tests/atol.c 28 Jan 2009 14:45:34 -0000 @@ -50,6 +50,7 @@ // INCLUDES +#include #include #include @@ -92,8 +93,12 @@ test( CYG_ADDRWORD data ) "atol() function"); } // test() +#ifndef CYGPKG_LIBC_STARTUP +void cyg_user_start(void) +#else int -main(int argc, char *argv[]) +main( int argc, char *argv[] ) +#endif { CYG_TEST_INIT(); Index: tests/bsearch.c =================================================================== RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdlib/current/tests/bsearch.c,v retrieving revision 1.3 diff -u -p -r1.3 bsearch.c --- tests/bsearch.c 23 May 2002 23:07:22 -0000 1.3 +++ tests/bsearch.c 28 Jan 2009 14:45:34 -0000 @@ -50,6 +50,7 @@ // INCLUDES +#include #include #include @@ -67,8 +68,12 @@ Compar( const void *int1, const void *in return 1; } // Compar() +#ifndef CYGPKG_LIBC_STARTUP +void cyg_user_start(void) +#else int main( int argc, char *argv[] ) +#endif { int key; int *result; Index: tests/div.c =================================================================== RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdlib/current/tests/div.c,v retrieving revision 1.3 diff -u -p -r1.3 div.c --- tests/div.c 23 May 2002 23:07:22 -0000 1.3 +++ tests/div.c 28 Jan 2009 14:45:34 -0000 @@ -50,13 +50,18 @@ // INCLUDES +#include #include #include // FUNCTIONS +#ifndef CYGPKG_LIBC_STARTUP +void cyg_user_start(void) +#else int main( int argc, char *argv[] ) +#endif { int num, denom; div_t result; Index: tests/getenv.c =================================================================== RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdlib/current/tests/getenv.c,v retrieving revision 1.3 diff -u -p -r1.3 getenv.c --- tests/getenv.c 23 May 2002 23:07:22 -0000 1.3 +++ tests/getenv.c 28 Jan 2009 14:45:34 -0000 @@ -50,6 +50,7 @@ // INCLUDES +#include #include // Main header for stdlib functions #include // Testcase API @@ -71,8 +72,12 @@ my_strcmp(const char *s1, const char *s2 return (*s1 - *s2); } // my_strcmp() +#ifndef CYGPKG_LIBC_STARTUP +void cyg_user_start(void) +#else int main( int argc, char *argv[] ) +#endif { char *str; Index: tests/labs.c =================================================================== RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdlib/current/tests/labs.c,v retrieving revision 1.3 diff -u -p -r1.3 labs.c --- tests/labs.c 23 May 2002 23:07:22 -0000 1.3 +++ tests/labs.c 28 Jan 2009 14:45:35 -0000 @@ -50,13 +50,18 @@ // INCLUDES +#include #include #include // FUNCTIONS +#ifndef CYGPKG_LIBC_STARTUP +void cyg_user_start(void) +#else int main( int argc, char *argv[] ) +#endif { int x; Index: tests/ldiv.c =================================================================== RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdlib/current/tests/ldiv.c,v retrieving revision 1.3 diff -u -p -r1.3 ldiv.c --- tests/ldiv.c 23 May 2002 23:07:22 -0000 1.3 +++ tests/ldiv.c 28 Jan 2009 14:45:35 -0000 @@ -50,14 +50,19 @@ // INCLUDES +#include #include #include // FUNCTIONS +#ifndef CYGPKG_LIBC_STARTUP +void cyg_user_start(void) +#else int main( int argc, char *argv[] ) +#endif { long num, denom; ldiv_t result; Index: tests/qsort.c =================================================================== RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdlib/current/tests/qsort.c,v retrieving revision 1.3 diff -u -p -r1.3 qsort.c --- tests/qsort.c 23 May 2002 23:07:22 -0000 1.3 +++ tests/qsort.c 28 Jan 2009 14:45:35 -0000 @@ -50,6 +50,7 @@ // INCLUDES +#include #include #include @@ -68,8 +69,12 @@ Compar( const void *int1, const void *in return 1; } // Compar() +#ifndef CYGPKG_LIBC_STARTUP +void cyg_user_start(void) +#else int main( int argc, char *argv[] ) +#endif { unsigned int ctr; int fail=0; Index: tests/rand1.c =================================================================== RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdlib/current/tests/rand1.c,v retrieving revision 1.3 diff -u -p -r1.3 rand1.c --- tests/rand1.c 23 May 2002 23:07:22 -0000 1.3 +++ tests/rand1.c 28 Jan 2009 14:45:35 -0000 @@ -50,6 +50,7 @@ // INCLUDES +#include #include #include @@ -84,8 +85,12 @@ test( CYG_ADDRWORD data ) "C library rand() function"); } // test() +#ifndef CYGPKG_LIBC_STARTUP +void cyg_user_start(void) +#else int -main(int argc, char *argv[]) +main( int argc, char *argv[] ) +#endif { CYG_TEST_INIT(); Index: tests/rand2.c =================================================================== RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdlib/current/tests/rand2.c,v retrieving revision 1.3 diff -u -p -r1.3 rand2.c --- tests/rand2.c 23 May 2002 23:07:22 -0000 1.3 +++ tests/rand2.c 28 Jan 2009 14:45:35 -0000 @@ -50,6 +50,7 @@ // INCLUDES +#include #include // CYGNUM_LIBC_RAND_SEED #include #include @@ -90,8 +91,12 @@ test( CYG_ADDRWORD data ) "library rand() function"); } // test() +#ifndef CYGPKG_LIBC_STARTUP +void cyg_user_start(void) +#else int -main(int argc, char *argv[]) +main( int argc, char *argv[] ) +#endif { CYG_TEST_INIT(); Index: tests/rand3.c =================================================================== RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdlib/current/tests/rand3.c,v retrieving revision 1.3 diff -u -p -r1.3 rand3.c --- tests/rand3.c 23 May 2002 23:07:22 -0000 1.3 +++ tests/rand3.c 28 Jan 2009 14:45:35 -0000 @@ -52,6 +52,7 @@ // INCLUDES +#include #include #include @@ -83,8 +84,12 @@ my_abs(int i) return (i < 0) ? -i : i; } // my_abs() +#ifndef CYGPKG_LIBC_STARTUP +void cyg_user_start(void) +#else int -main(int argc, char *argv[]) +main( int argc, char *argv[] ) +#endif { // divide the space from 0..RAND_MAX into NUM_BUCKETS categories *BUT* // RAND_MAX / NUM_BUCKETS may not divide exactly so we leave space for Index: tests/rand4.c =================================================================== RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdlib/current/tests/rand4.c,v retrieving revision 1.3 diff -u -p -r1.3 rand4.c --- tests/rand4.c 23 May 2002 23:07:23 -0000 1.3 +++ tests/rand4.c 28 Jan 2009 14:45:35 -0000 @@ -52,6 +52,7 @@ // CONFIGURATION +#include #include // Configuration header // INCLUDES @@ -69,8 +70,12 @@ // FUNCTIONS +#ifndef CYGPKG_LIBC_STARTUP +void cyg_user_start(void) +#else int -main(int argc, char *argv[]) +main( int argc, char *argv[] ) +#endif { #if TEST_VALID int i; Index: tests/srand.c =================================================================== RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdlib/current/tests/srand.c,v retrieving revision 1.3 diff -u -p -r1.3 srand.c --- tests/srand.c 23 May 2002 23:07:23 -0000 1.3 +++ tests/srand.c 28 Jan 2009 14:45:35 -0000 @@ -50,6 +50,7 @@ // INCLUDES +#include #include #include @@ -112,8 +113,12 @@ test( CYG_ADDRWORD data ) "C library srand() function"); } // test() +#ifndef CYGPKG_LIBC_STARTUP +void cyg_user_start(void) +#else int -main(int argc, char *argv[]) +main( int argc, char *argv[] ) +#endif { CYG_TEST_INIT(); Index: tests/strtol.c =================================================================== RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdlib/current/tests/strtol.c,v retrieving revision 1.3 diff -u -p -r1.3 strtol.c --- tests/strtol.c 23 May 2002 23:07:23 -0000 1.3 +++ tests/strtol.c 28 Jan 2009 14:45:35 -0000 @@ -50,6 +50,7 @@ // INCLUDES +#include #include #include #include @@ -166,8 +167,12 @@ test( CYG_ADDRWORD data ) "strtol() function"); } // test() +#ifndef CYGPKG_LIBC_STARTUP +void cyg_user_start(void) +#else int -main(int argc, char *argv[]) +main( int argc, char *argv[] ) +#endif { CYG_TEST_INIT(); Index: tests/strtoul.c =================================================================== RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdlib/current/tests/strtoul.c,v retrieving revision 1.3 diff -u -p -r1.3 strtoul.c --- tests/strtoul.c 23 May 2002 23:07:23 -0000 1.3 +++ tests/strtoul.c 28 Jan 2009 14:45:35 -0000 @@ -50,6 +50,7 @@ // INCLUDES +#include #include #include #include @@ -162,8 +163,12 @@ test( CYG_ADDRWORD data ) "strtoul() function"); } // test() +#ifndef CYGPKG_LIBC_STARTUP +void cyg_user_start(void) +#else int -main(int argc, char *argv[]) +main( int argc, char *argv[] ) +#endif { CYG_TEST_INIT();