mirror of
https://github.com/cc65/cc65.git
synced 2025-08-13 08:25:28 +00:00
added some ifdefs to make testcode compile for apple2 and atari targets
This commit is contained in:
@@ -19,9 +19,13 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <cbm.h>
|
|
||||||
#include <conio.h>
|
#include <conio.h>
|
||||||
|
|
||||||
|
#if defined(__CBM__)
|
||||||
|
#include <cbm.h>
|
||||||
|
#elif defined(__APPLE2__)
|
||||||
|
#include <apple2.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
@@ -51,9 +55,13 @@ int main(void)
|
|||||||
printf("contents of \"%s\":\n", name);
|
printf("contents of \"%s\":\n", name);
|
||||||
while ((E = readdir (D)) != 0) {
|
while ((E = readdir (D)) != 0) {
|
||||||
printf ("dirent.d_name[] : \"%s\"\n", E->d_name);
|
printf ("dirent.d_name[] : \"%s\"\n", E->d_name);
|
||||||
|
#if !defined(__ATARI__)
|
||||||
printf ("dirent.d_blocks : %10u\n", E->d_blocks);
|
printf ("dirent.d_blocks : %10u\n", E->d_blocks);
|
||||||
|
#endif
|
||||||
printf ("dirent.d_type : %10d\n", E->d_type);
|
printf ("dirent.d_type : %10d\n", E->d_type);
|
||||||
|
#if !defined(__APPLE2__) && !defined(__ATARI__)
|
||||||
printf ("telldir() : %10lu\n", telldir (D));
|
printf ("telldir() : %10lu\n", telldir (D));
|
||||||
|
#endif
|
||||||
printf ("---\n");
|
printf ("---\n");
|
||||||
if (!go) {
|
if (!go) {
|
||||||
switch (cgetc ()) {
|
switch (cgetc ()) {
|
||||||
@@ -63,14 +71,16 @@ int main(void)
|
|||||||
|
|
||||||
case 'q':
|
case 'q':
|
||||||
goto done;
|
goto done;
|
||||||
|
#if !defined(__APPLE2__) && !defined(__ATARI__)
|
||||||
case 'r':
|
case 'r':
|
||||||
seekdir (D, E->d_off);
|
seekdir (D, E->d_off);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
#if !defined(__ATARI__)
|
||||||
case 's':
|
case 's':
|
||||||
rewinddir (D);
|
rewinddir (D);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -214,10 +214,10 @@ int main (void)
|
|||||||
|
|
||||||
/* Show info at start */
|
/* Show info at start */
|
||||||
ShowInfo ();
|
ShowInfo ();
|
||||||
|
#if !defined(__APPLE2__)
|
||||||
/* Remember the time */
|
/* Remember the time */
|
||||||
T = clock ();
|
T = clock ();
|
||||||
|
#endif
|
||||||
/* Do the tests */
|
/* Do the tests */
|
||||||
Test1 ();
|
Test1 ();
|
||||||
Test2 ();
|
Test2 ();
|
||||||
@@ -226,10 +226,11 @@ int main (void)
|
|||||||
Test5 ();
|
Test5 ();
|
||||||
Test6 ();
|
Test6 ();
|
||||||
|
|
||||||
|
#if !defined(__APPLE2__)
|
||||||
/* Calculate the time and print it */
|
/* Calculate the time and print it */
|
||||||
T = clock () - T;
|
T = clock () - T;
|
||||||
printf ("Time needed: %lu ticks\n", T);
|
printf ("Time needed: %lu ticks\n", T);
|
||||||
|
#endif
|
||||||
/* Done */
|
/* Done */
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@@ -190,7 +190,7 @@ int main (void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Set dark-on-light colors. Clear the screen. */
|
/* Set dark-on-light colors. Clear the screen. */
|
||||||
#ifdef __CBM__
|
#if defined(__CBM__) && !defined(__VIC20__)
|
||||||
(void) bordercolor (COLOR_GRAY2);
|
(void) bordercolor (COLOR_GRAY2);
|
||||||
(void) bgcolor (COLOR_WHITE);
|
(void) bgcolor (COLOR_WHITE);
|
||||||
(void) textcolor (COLOR_GRAY1);
|
(void) textcolor (COLOR_GRAY1);
|
||||||
|
@@ -84,19 +84,21 @@ int main (void)
|
|||||||
|
|
||||||
/* Show info at start */
|
/* Show info at start */
|
||||||
ShowInfo ();
|
ShowInfo ();
|
||||||
|
#if !defined(__APPLE2__)
|
||||||
/* Remember the time */
|
/* Remember the time */
|
||||||
T = clock ();
|
T = clock ();
|
||||||
|
#endif
|
||||||
/* Do the tests */
|
/* Do the tests */
|
||||||
FillArray ();
|
FillArray ();
|
||||||
ShowInfo ();
|
ShowInfo ();
|
||||||
FreeArray ();
|
FreeArray ();
|
||||||
ShowInfo ();
|
ShowInfo ();
|
||||||
|
|
||||||
|
#if !defined(__APPLE2__)
|
||||||
/* Calculate the time and print it */
|
/* Calculate the time and print it */
|
||||||
T = clock () - T;
|
T = clock () - T;
|
||||||
printf ("Time needed: %lu ticks\n", T);
|
printf ("Time needed: %lu ticks\n", T);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Done */
|
/* Done */
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
Reference in New Issue
Block a user