Here are some of the cpp macros used, together with some short explanation
of their use. Feel free to add more macros and more categories.
+Most of these are from config.in, so it's probably better to put the
+explanations in that file. Ideally, everything would be defined and
+documented in config.in, and this file would not be necessary.
+
** Distinguishing OSes **
+AIX
+_AIX
+BSD4_2
+BSD_SYSTEM
CYGWIN Compiling the Cygwin port.
__CYGWIN__ Ditto
+GNU_LINUX
+HPUX
+IRIX6_5
MSDOS Compiling the MS-DOS port.
__MSDOS__ Ditto.
__DJGPP_MINOR__ Minor version number of the DJGPP library; used only in msdos.c and dosfns.c.
__MINGW32__ Compiling the W32 port with the MinGW port of GCC.
_MSC_VER Compiling the W32 port with the Microsoft C compiler.
DARWIN_OS Compiling on Mac OS X or pure Darwin (and using s/darwin.h).
+SOLARIS2
+USG
+USG5
+USG5_4
** Distinguishing GUIs **
REL_ALLOC Compile in the relocatable memory allocator ralloc.c.
SYSTEM_MALLOC Use the system library's malloc.
-subprocesses System can use subprocesses (for M-x shell for example). Defined by default, only MSDOS undefines it.
-USE_LISP_UNION_TYPE Define it in lisp.h to make Lisp_Object be a union type instead of the default int.
+subprocesses System can use subprocesses (for M-x shell for example).
+ Defined by default, only MSDOS undefines it.
+DEBUG_LISP_OBJECT_TYPE Define it in lisp.h enable compile time checks
+ on Lisp_Object use.
-** System specific macros, decribed in detail in src/s/template.h
-CLASH_DETECTION
-COFF
+** System specific macros
FIRST_PTY_LETTER
HAVE_PTYS
-HAVE_TERMIO
-HAVE_TERMIOS
INTERRUPT_INPUT
NARROWPROTO
SEPCHAR
-SIGTYPE
SYSTEM_TYPE
-** Machine specific macros, decribed in detail in src/m/template.h
-VIRT_ADDR_VARIES
-
** Misc macros
-USER_FULL_NAME If defined, overrides the default pw->pw_gecos for getting at the full user name. Only MSDOS overrides the default.
+USER_FULL_NAME If defined, overrides the default pw->pw_gecos for
+getting at the full user name. Only MSDOS overrides the default.
-** Replace, the definition is trivial: SWITCH_ENUM_CAST
+** Miscellaneous defines. Some of these might not be used in the code
+anymore, so they can be removed.
-** Defines from src/m/*.h and src/s/*.h. Some of these might not be used in the code anymore, so they can be removed. The HAVE_* definitions are probably handled by autoconf, so it might be possible to just remove them from src/[sm]/*.h.
-
-
-AIX
AMPERSAND_FULL_NAME
-BITS_PER_EMACS_INT
-BITS_PER_LONG
-BITS_PER_CHAR
-BITS_PER_SHORT
-BITS_PER_INT
BROKEN_DATAGRAM_SOCKETS
BROKEN_FIONREAD
BROKEN_GET_CURRENT_DIR_NAME
BROKEN_SIGIO
BROKEN_SIGPOLL
BROKEN_SIGPTY
-BSD4_2
-BSD4_3
-BSD_SYSTEM
CLASH_DETECTION
DATA_SEG_BITS
DATA_START
EMACS_CONFIG_OPTIONS
EMACS_INT
EMACS_UINT
-FILE_SYSTEM_CASE
FLOAT_CHECK_DOMAIN
GC_LISP_OBJECT_ALIGNMENT
GC_MARK_SECONDARY_STACK
GC_SETJMP_WORKS
GMALLOC_INHIBIT_VALLOC
GNU_LIBRARY_PENDING_OUTPUT_COUNT
-GNU_LINUX
GNU_MALLOC
HAVE_AIX_SMT_EXP
HAVE_CBRT
HAVE_FPATHCONF
HAVE_FREXP
HAVE_FSYNC
-HAVE_FTIME
HAVE_GETCWD
-HAVE_GETDOMAINNAME
HAVE_GETHOSTNAME
HAVE_GETLOADAVG
HAVE_GETPAGESIZE
HAVE_LONG_FILE_NAMES
HAVE_LRAND48
HAVE_MENUS
-HAVE_MKDIR
HAVE_MKTIME
HAVE_MOUSE
-HAVE_PERROR
HAVE_PSTAT_GETDYNAMIC
HAVE_PWD_H
HAVE_RANDOM
-HAVE_RENAME
HAVE_RES_INIT
HAVE_RINT
-HAVE_RMDIR
HAVE_SELECT
HAVE_SETLOCALE
HAVE_SETPGID
HAVE_SOCKETS
HAVE_SOUND
HAVE_STDLIB_H
-HAVE_STRERROR
HAVE_STRFTIME
HAVE_STRING_H
HAVE_STRUCT_UTIMBUF
-HAVE_SYSINFO
-HAVE_SYSV_SIGPAUSE
HAVE_SYS_SELECT_H
HAVE_SYS_SYSTEMINFO_H
HAVE_SYS_TIMEB_H
HAVE_SYS_TIME_H
HAVE_TCATTR
-HAVE_TERMIOS_H
-HAVE_TIMEVAL
HAVE_TM_ZONE
HAVE_TZSET
HAVE_UNISTD_H
-HAVE_UTIMES
HAVE_UTIME_H
HAVE_WINDOW_SYSTEM
HAVE_WORKING_VFORK
HAVE_XRMSETDATABASE
-HPUX
INTERNAL_TERMINAL
IS_ANY_SEP
IS_DIRECTORY_SEP
-LINKER
LINUX_VERSION_CODE
-LISP_FLOAT_TYPE
-LNOFLSH
LOCALTIME_CACHE
MAIL_USE_FLOCK
MAIL_USE_LOCKF
MAIL_USE_POP
MAIL_USE_SYSTEM_LOCK
MAXPATHLEN
-MIN_PTY_KERNEL_VERSION -- only used on Mac
MODE_LINE_BINARY_TEXT
MUST_UNDEF__STDC__
NLIST_STRUCT
NO_TERMIO
NSIG
NSIG_MINIMUM
-NULL
NULL_DEVICE
ORDINARY_LINK
O_APPEND
O_RDWR
PAGESIZE
PENDING_OUTPUT_COUNT
-POSIX
PREFER_VSUSP
PTY_ITERATION
PTY_NAME_SPRINTF
SIGPIPE
SIGQUIT
SIGTRAP
-SIGTYPE
-SOLARIS2
STDC_HEADERS
SYSTEM_PURESIZE_EXTRA
SYSTEM_MALLOC
UNIX98_PTYS
USE_CRT_DLL
USE_TOOLKIT_SCROLL_BARS
-USG
-USG5
-USG5_4
USG_SUBTTY_WORKS
VALBITS
-WRETCODE
-XINT
XOS_NEEDS_TIME_H
-XPNTR
-XSET
-XUINT
-_AIX
-_ARCH_PPC64
-_CALLBACK_
_FILE_OFFSET_BITS
_LP64
_MALLOC_INTERNAL
_VARARGS_
_WINSOCKAPI_
_WINSOCK_H
-__ELF__
-__FreeBSD__
-__GNUC__
-__GNU_LIBRARY__
-__GNUC_MINOR__
-__NetBSD__
-__OpenBSD__
-__STDC__
-__arch64__
-__cplusplus
-__hpux
-__ia64__
-__linux__
-__mc68000__
-__mips__
_longjmp
_setjmp
_start
chmod
chown
close
-const
creat
ctime
dup
getpid
getuid
gmtime
-i386
index
-init_process
isatty
kill
link
localtime
logb
lseek
-m68k
malloc
mkdir
mktemp
spawnve
srandom
strdup
-strerror
stricmp
strnicmp
strupr