| Line | |
|---|
| 1 | /* $Id: prog-cxx.cpp,v 1.1 2002-05-16 11:37:08 bird Exp $
|
|---|
| 2 | *
|
|---|
| 3 | * Test program.
|
|---|
| 4 | *
|
|---|
| 5 | * Copyright (c) 2002 knut st. osmundsen (bird@anduin.net)
|
|---|
| 6 | *
|
|---|
| 7 | * GPL
|
|---|
| 8 | *
|
|---|
| 9 | */
|
|---|
| 10 |
|
|---|
| 11 | /*******************************************************************************
|
|---|
| 12 | * Defined Constants And Macros *
|
|---|
| 13 | *******************************************************************************/
|
|---|
| 14 | #ifdef DEBUG
|
|---|
| 15 | #define _STR "\"DEBUG\" "
|
|---|
| 16 | #else
|
|---|
| 17 | #define _STR ""
|
|---|
| 18 | #endif
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 | /*******************************************************************************
|
|---|
| 22 | * Header Files *
|
|---|
| 23 | *******************************************************************************/
|
|---|
| 24 | #include <stdio.h>
|
|---|
| 25 | #include <math.h>
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 | /**
|
|---|
| 29 | * Testprogram.
|
|---|
| 30 | * @returns 0 on success.
|
|---|
| 31 | */
|
|---|
| 32 | int main(void)
|
|---|
| 33 | {
|
|---|
| 34 | long double lrd = asin(cos(0));
|
|---|
| 35 | #ifdef __cplusplus
|
|---|
| 36 | puts("Hello \"C++\" "_STR"World!\n");
|
|---|
| 37 | #else
|
|---|
| 38 | puts("Hello \"C\" "_STR"World!\n");
|
|---|
| 39 | #endif
|
|---|
| 40 |
|
|---|
| 41 | /*
|
|---|
| 42 | * Define assertions.
|
|---|
| 43 | */
|
|---|
| 44 | #ifdef __32BIT__
|
|---|
| 45 | # ifdef __16BIT__
|
|---|
| 46 | puts("error: __16BIT__ && __32BIT__ is defined!\n");
|
|---|
| 47 | # else
|
|---|
| 48 | puts("__32BIT__\n");
|
|---|
| 49 | # endif
|
|---|
| 50 | #else
|
|---|
| 51 | # ifdef __16BIT__
|
|---|
| 52 | puts("__16BIT__\n");
|
|---|
| 53 | # else
|
|---|
| 54 | puts("error: __16BIT__ nor __32BIT__ is defined!\n");
|
|---|
| 55 | # endif
|
|---|
| 56 |
|
|---|
| 57 | #endif
|
|---|
| 58 |
|
|---|
| 59 | #if !defined(OS2) && !defined(WIN32) && !defined(LINUX)
|
|---|
| 60 | puts("error: OS is not defined!\n");
|
|---|
| 61 | #endif
|
|---|
| 62 |
|
|---|
| 63 | return 0;
|
|---|
| 64 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.