mirror of
https://github.com/Interlisp/maiko.git
synced 2026-01-14 15:36:34 +00:00
Fixup xdefs.h (#76)
Update guard name to match file name and protect entire file
Only declare extern lock variables when doing locking
Include system headers that locking macros depend on
Convert code block macros to do { } while (0) statement style
This commit is contained in:
parent
7a1569a5ba
commit
a97b2a3501
27
inc/xdefs.h
27
inc/xdefs.h
@ -8,6 +8,8 @@
|
||||
/* Manufactured in the United States of America. */
|
||||
/* */
|
||||
/************************************************************************/
|
||||
#ifndef XDEFS_H
|
||||
#define XDEFS_H 1
|
||||
|
||||
#define DEF_WIN_X 20
|
||||
#define DEF_WIN_Y 20
|
||||
@ -26,30 +28,28 @@
|
||||
#define SCROLL_PITCH 30
|
||||
|
||||
|
||||
#ifndef __LDEXDEF__
|
||||
|
||||
#define __LDEXDEF__ 1
|
||||
#include <signal.h>
|
||||
#ifdef LOCK_X_UPDATES
|
||||
#define XLOCK { XLocked++; /* printf("L"); fflush(stdout);*/}
|
||||
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
extern int XLocked;
|
||||
extern int XNeedSignal;
|
||||
/* this is !0 if we're locked; it should be 0 or larger always */
|
||||
|
||||
#define XLOCK do { XLocked++; /* printf("L"); fflush(stdout);*/} while (0)
|
||||
#define XUNLOCK \
|
||||
{ XLocked--;/* printf("U"); fflush(stdout);*/ \
|
||||
do { XLocked--;/* printf("U"); fflush(stdout);*/ \
|
||||
if (XNeedSignal) \
|
||||
{ \
|
||||
XNeedSignal = 0; \
|
||||
kill(getpid(), SIGPOLL); \
|
||||
}; \
|
||||
}
|
||||
}; \
|
||||
} while (0)
|
||||
#else
|
||||
#define XLOCK
|
||||
#define XUNLOCK
|
||||
#endif /* LOCK_X_UPDATES */
|
||||
|
||||
extern int XLocked;
|
||||
extern int XNeedSignal;
|
||||
/* this is !0 if we're locked; it should be 0 or larger always */
|
||||
#endif
|
||||
|
||||
#ifdef XWINDOW
|
||||
#ifdef XV11R4
|
||||
#undef XV11R1
|
||||
@ -82,3 +82,4 @@ extern int XNeedSignal;
|
||||
#define XV11R4 /* newest version */
|
||||
#endif
|
||||
#endif /* XWINDOW */
|
||||
#endif /* XDEFS_H */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user