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