Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/contrib/doom/doomtype.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ typedef unsigned char byte;


// Predefined with some OS.
#ifdef LINUX
#if defined(LINUX) && LINUX
#include <values.h>
#else
#ifndef MAXCHAR
Expand Down
8 changes: 6 additions & 2 deletions src/contrib/nanox-test/nterm.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
* Greg Haerr
*/

#if LINUX | MACOSX
#if defined(LINUX) && LINUX
#define UNIX98 1 /* use new-style /dev/ptmx, /dev/pts/0*/
#elif defined(MACOSX) && MACOSX
#define UNIX98 1 /* use new-style /dev/ptmx, /dev/pts/0*/
#elif !defined(UNIX98)
#define UNIX98 0
#endif
#define _XOPEN_SOURCE 600
#include <stdio.h>
Expand Down Expand Up @@ -160,7 +164,7 @@ HandleEvent(GR_EVENT *ep)
}
}

#if ELKS
#if defined(ELKS) && ELKS
char * nargv[2] = {"/bin/sash", NULL};
#else
#if DOS_DJGPP
Expand Down
4 changes: 2 additions & 2 deletions src/contrib/nanox-test/select.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <unistd.h>
#include <sys/time.h>
#endif
#if ELKS
#if defined(ELKS) && ELKS
#include <linuxmt/posix_types.h>
#include <linuxmt/time.h>
#endif
Expand Down Expand Up @@ -53,7 +53,7 @@ GsTerminate(void)
exit(0);
}

#if MSDOS
#if defined(MSDOS) && MSDOS
void
GsSelect(void)
{
Expand Down
6 changes: 3 additions & 3 deletions src/contrib/vnc/srvmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "uni_std.h"
#include "sys_time.h"

#if RTEMS
#if defined(RTEMS) && RTEMS
#include <rtems/mw_uid.h>
#endif

Expand Down Expand Up @@ -262,7 +262,7 @@ GrOpen(void)
}
SERVER_UNLOCK();

#if MSDOS
#if defined(MSDOS) && MSDOS
atexit(GsTerminate);
#endif
#endif /* NONETWORK*/
Expand Down Expand Up @@ -650,7 +650,7 @@ GsSelect(GR_TIMEOUT timeout)
}

/********************************************************************************/
#elif RTEMS
#elif defined(RTEMS) && RTEMS
extern struct MW_UID_MESSAGE m_kbd;
extern struct MW_UID_MESSAGE m_mou;

Expand Down
4 changes: 2 additions & 2 deletions src/contrib/winextra/extra_windef.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ typedef unsigned int UINT32, *PUINT32;
//typedef uint32_t DWORD_PTR, UINT_PTR, *PUINT_PTR;
#endif

#if _MSC_VER
#if defined(_MSC_VER) && _MSC_VER
typedef __int64 LONG64, *PLONG64;
typedef __int64 INT64, *PINT64;
typedef unsigned __int64 ULONG64, *PULONG64;
Expand All @@ -33,7 +33,7 @@ typedef unsigned long long DWORD64, *PDWORD64;
typedef unsigned long long UINT64, *PUINT64;
#endif

#if _MSC_VER
#if defined(_MSC_VER) && _MSC_VER
typedef __int64 LONGLONG;
typedef unsigned __int64 ULONGLONG;
#else
Expand Down
2 changes: 1 addition & 1 deletion src/contrib/winextra/winbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ typedef struct {
} BITMAPV5HEADER, *LPBITMAPV5HEADER, *PBITMAPV5HEADER;


#if _MSC_VER
#if defined(_MSC_VER) && _MSC_VER
typedef __int64 LONGLONG;
typedef unsigned __int64 ULONGLONG;
#else
Expand Down
6 changes: 4 additions & 2 deletions src/demos/mwin/mwdemo.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ unsigned _stklen = 4096;
/* not used*/
#define CLIENT3D 0 /* old client draw test*/

#if RTEMS
#if defined(RTEMS) && RTEMS
#undef GRAPH3D
#undef CONTROLS
#define CONTROLS 1 /* win32 controls demo*/
Expand All @@ -59,7 +59,9 @@ extern MWIMAGEHDR image_cs1;
extern MWIMAGEHDR image_rle8;

#if CONTROLS
#if ELKS | MSDOS
#if defined(ELKS) && ELKS
PMWIMAGEHDR image = &image_cs1; /* 2 color bitmap for 16 color systems*/
#elif defined(MSDOS) && MSDOS
PMWIMAGEHDR image = &image_cs1; /* 2 color bitmap for 16 color systems*/
#else
PMWIMAGEHDR image = &image_penguin;
Expand Down
2 changes: 1 addition & 1 deletion src/demos/mwin/mwmine.c
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ LRESULT TestMyWinProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
bom[ran1][ran2].flag = 1;
i++;
}
#if RTEMS
#if defined(RTEMS) && RTEMS
else i++; /* bad rtems random function*/
#endif
}
Expand Down
4 changes: 2 additions & 2 deletions src/demos/mwin/mwterm.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/*#define FONTNAME OEM_FIXED_FONT*/
#define APPCLASS "mterm"

#if ELKS
#if defined(ELKS) && ELKS
#define SHELL "/bin/sash"
#elif DOS_DJGPP
#define SHELL "bash"
Expand Down Expand Up @@ -252,7 +252,7 @@ ptysignaled(int signo)
{
switch(signo) {
case SIGINT: /* interrupt*/
#if !ELKS
#if !defined(ELKS) || !ELKS
/* this doesn't work, can anyone fix it?*/
killpg(pid, SIGINT);
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/demos/nanox/nxcalc.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <ctype.h>
#include <math.h>
#include "nano-X.h"
#if ELKS
#if defined(ELKS) && ELKS
#include <sys/linksym.h>
#endif

Expand Down Expand Up @@ -55,7 +55,7 @@ static double display_to_double(void) {
}

static void set_display_from_double(double v) {
#if ELKS
#if defined(ELKS) && ELKS
__LINK_SYMBOL(dtostr);
#endif
char buf[128];
Expand Down
4 changes: 2 additions & 2 deletions src/demos/nanox/nxmine.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#define FULLSIZE (MAXSIZE + 2) /* board size including borders */

#if __ECOS
#if defined(__ECOS) && __ECOS
/* 240x320 screen values*/
#define BOARDGAP 2 /* millimeter gap around board */
#define RIGHTGAP 2 /* mm gap between board, right side */
Expand Down Expand Up @@ -825,7 +825,7 @@ delay(void)
{
GR_COUNT i;

#if ELKS
#if defined(ELKS) && ELKS
i = 32000;
do {
GrFlush();
Expand Down
4 changes: 2 additions & 2 deletions src/demos/nanox/nxstart.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static void do_buttonup(GR_EVENT_BUTTON *ep);
static void do_update(GR_EVENT_UPDATE *ep);
static void do_mouse(GR_EVENT_MOUSE *ep);

#if ELKS
#if defined(ELKS) && ELKS
#define PATH "/bin/"
#else
#define PATH "bin/"
Expand All @@ -71,7 +71,7 @@ struct app_info {
{"tetris", PATH "nxtetris"},
{"world", PATH "nxworld"},
{"landmine",PATH "nxmine"},
#if ELKS
#if defined(ELKS) && ELKS
{"calculator",PATH "nxcalc"},
#else
{"aafont", PATH "demo-aafont"},
Expand Down
6 changes: 3 additions & 3 deletions src/demos/nanox/nxterm.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
#include <termios.h>
#endif

#if ELKS
#if defined(ELKS) && ELKS
#define stdcol 80
#define stdrow 25
#define KBDBUF 1024
Expand Down Expand Up @@ -950,7 +950,7 @@ scrolltop, scrollbottom = upper and lower scroll region limit in lines/rows
break;

case 'n':/* DSR device status report */
#if ELKS
#if defined(ELKS) && ELKS
strcpy(buf, "\033[");
strcat(buf, itoa(cury+1));
strcat(buf, ";");
Expand Down Expand Up @@ -1774,7 +1774,7 @@ char * nargv[2] = {"bash", NULL};
char * nargv[2] = {"/bin/sh", NULL};
#endif

#if ELKS
#if defined(ELKS) && ELKS
int term_init(void)
{
int tfd;
Expand Down
10 changes: 9 additions & 1 deletion src/demos/nanox/nxterm.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@
* ++eero
*/

#if LINUX | MACOSX
#if defined(LINUX) && LINUX
#define USE_NGTERM 1
#elif defined(MACOSX) && MACOSX
#define USE_NGTERM 1
#else
#define USE_NGTERM 0
#endif

#if USE_NGTERM
static char termtype_string[] = "TERM=ngterm";
static char termcap_string[1024] =
"TERMCAP=ngterm|nano-X vt52 terminal:\
Expand Down
2 changes: 1 addition & 1 deletion src/demos/nanox/nxtetris.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
#include "nxcolors.h"
#include "nxtetris.h"

#if ELKS
#if defined(ELKS) && ELKS
#define srandom srand
#define random rand
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/demos/nanox/nxtetris.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* array of shape descriptions (you can add your own new shapes quite easily).
*/

#ifndef __ECOS
#if !defined(__ECOS) || !__ECOS
//#define USE_HISCORE_FILE
#define HISCORE_FILE "/usr/games/nanotetris.hiscore"
#endif
Expand All @@ -58,7 +58,7 @@
extern int WELL_HEIGHT, WELL_VISIBLE_HEIGHT;
#define WELL_NOTVISIBLE (WELL_HEIGHT - WELL_VISIBLE_HEIGHT)
#define LEVEL_DIVISOR 500
#ifdef __ECOS
#if defined(__ECOS) && __ECOS
#define DROP_BLOCK_DELAY 10
#else
#define DROP_BLOCK_DELAY 25
Expand Down
4 changes: 2 additions & 2 deletions src/demos/nanox/nxworld.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#define MAPW 400
#define MAPH 240
#if ELKS
#if defined(ELKS) && ELKS
#define MAPFILE "/lib/nxworld.map"
#else
#define MAPFILE "images/demos/nanox/nxworld.map"
Expand Down Expand Up @@ -167,7 +167,7 @@ main(int argc, char **argv)

GrGetScreenInfo(&si);

#if __ECOS /* 240x320 screen*/
#if defined(__ECOS) && __ECOS /* 240x320 screen*/
COLS = si.cols - 10;
ROWS = si.rows - 40;
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/demos/nxscribble/li_recognizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static char *lialg_recognize_stroke(rClassifier *, point_list *);
char* li_err_msg = NULL;
char _zdebug_flag[128];

#if __ECOS
#if defined(__ECOS) && __ECOS
#define BCOPY bcopy
#else
/* This is standard - defined in <stdlib.h> */
Expand Down
2 changes: 1 addition & 1 deletion src/demos/nxscribble/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ int GdError(const char *format, ...);

/* various BSD to lattice C name changes */

#ifdef __ECOS
#if defined(__ECOS) && __ECOS
extern char *strdup(char *);
#endif
#define index strchr
Expand Down
4 changes: 2 additions & 2 deletions src/demos/tuxchess/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#if RTEMS
#if defined(RTEMS) && RTEMS
#include <time.h>
#else
#include <sys/time.h>
Expand Down Expand Up @@ -138,7 +138,7 @@ BOOL ftime_ok = FALSE; /* does ftime return milliseconds? */
*/
int get_ms(void)
{
#if RTEMS
#if defined(RTEMS) && RTEMS
struct timespec tp;

clock_gettime( CLOCK_REALTIME, &tp );
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/deprecated/kbd_ipaq.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#define IPAQ_SCANCODE_ACTION 138
#define IPAQ_SCANCODE_SUSPEND 139

#if __ECOS
#if defined(__ECOS) && __ECOS
#define KEYBOARD "/dev/kbd"
#else
#define KEYBOARD "/dev/h3600_key"
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/deprecated/mou_ipaq.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <sys/ioctl.h>
#include "device.h"

#ifdef __ECOS
#if defined(__ECOS) && __ECOS
#define TOUCHDEVICE "/dev/ts" /* iPAQ*/
#else
#define TOUCHDEVICE "/dev/h3600_tsraw" /* iPAQ*/
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/deprecated/mwlirc.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static int mwlirc_buf_line_len = 0;

static int mwlirc_packet_state = MWLIRC_EXPECT_BEGIN;

#if TRIMEDIA
#if defined(TRIMEDIA) && TRIMEDIA
static char * my_strchr(char * buf, char ch)
{
while ((*buf != '\0') & (*buf != ch)) buf++;
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/deprecated/scr_allegro.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ allegro_open(PSD psd)
set_close_button_callback(close_button_proc);
set_color_depth(avbpp);

#if __MINGW32__
#if defined(__MINGW32__) && __MINGW32__
set_gfx_mode(GFX_GDI,1024,768,0,0); //GDI for Windows
#else
set_gfx_mode(GFX_XWINDOWS,640,480,0,0);
Expand Down
Loading