123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- #ifndef CMDLIB_H__
- #define CMDLIB_H__
- #if _MSC_VER >= 1000
- #pragma once
- #endif
- #ifdef __MINGW32__
- #include <io.h>
- #endif
- #ifdef HAVE_CONFIG_H
- #include "config.h"
- #endif
- #ifdef __GNUC__
- #define _alloca __builtin_alloca
- #define alloca __builtin_alloca
- #endif
- #include "win32fix.h"
- #include "mathtypes.h"
- #ifdef _DEBUG
- #define ZHLT_VERSIONSTRING "v3.9"
- #else
- #define ZHLT_VERSIONSTRING "3.9"
- #endif
- #if !defined(_WIN64)
- #if _M_IX86_FP == 0
- #define HACK_VERSIONSTRING "x86 (32b) SSE OFF"
- #endif
- #if _M_IX86_FP == 1
- #define HACK_VERSIONSTRING "x86 (32b) SSE1 ON"
- #endif
- #if _M_IX86_FP == 2
- #define HACK_VERSIONSTRING "x86 (32b) SSE2 ON"
- #endif
- #else
- #define HACK_VERSIONSTRING "x64 (64b) "
- #endif
- #define ZHLT_INFO_COMPILE_PARAMETERS
- #define ZHLT_NULLTEX
- #define ZHLT_TEXLIGHT
- #define ZHLT_GENERAL
- #define ZHLT_NEW_FILE_FUNCTIONS
- #define ZHLT_VectorMA_FIX
- #define ZHLT_PLANETYPE_FIX
- #define COMMON_HULLU
- #define HLCSG_CLIPECONOMY
- #define HLCSG_WADCFG
- #define HLCSG_AUTOWAD
- #define HLCSG_PRECISIONCLIP
- #define HLCSG_FASTFIND
- #ifdef ZHLT_NULLTEX
- #define HLCSG_NULLIFY_INVISIBLE
- #endif
- #define HLCSG_SORTBRUSH_FIX
- #define HLVIS_MAXDIST
- #define HLRAD_INFO_TEXLIGHTS
- #define HLRAD_WHOME
- #define HLRAD_HULLU
- #define HLRAD_FASTMATH
- #ifdef SYSTEM_WIN32
- #pragma warning(disable:4127 4115 4244 4786 4305 4800)
- #endif
- #ifdef STDC_HEADERS
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include <errno.h>
- #include <ctype.h>
- #include <time.h>
- #include <stdarg.h>
- #include <limits.h>
- #endif
- #ifdef HAVE_SYS_TIME_H
- #include <sys/time.h>
- #endif
- #ifdef HAVE_UNISTD_H
- #include <unistd.h>
- #endif
- #ifdef ZHLT_NETVIS
- #include "c2cpp.h"
- #endif
- #ifdef SYSTEM_WIN32
- #define SYSTEM_SLASH_CHAR '\\'
- #define SYSTEM_SLASH_STR "\\"
- #endif
- #ifdef SYSTEM_POSIX
- #define SYSTEM_SLASH_CHAR '/'
- #define SYSTEM_SLASH_STR "/"
- #endif
- #define myoffsetof(type,identifier) ((size_t)&((type*)0)->identifier)
- #define sizeofElement(type,identifier) (sizeof((type*)0)->identifier)
- #ifdef SYSTEM_POSIX
- extern char* strupr(char* string);
- extern char* strlwr(char* string);
- #endif
- extern const char* stristr(const char* const string, const char* const substring);
- extern bool CDECL safe_snprintf(char* const dest, const size_t count, const char* const args, ...);
- extern bool safe_strncpy(char* const dest, const char* const src, const size_t count);
- extern bool safe_strncat(char* const dest, const char* const src, const size_t count);
- extern bool TerminatedString(const char* buffer, const int size);
- extern char* FlipSlashes(char* string);
- extern double I_FloatTime();
- extern int CheckParm(char* check);
- extern void DefaultExtension(char* path, const char* extension);
- extern void DefaultPath(char* path, char* basepath);
- extern void StripFilename(char* path);
- extern void StripExtension(char* path);
- extern void ExtractFile(const char* const path, char* dest);
- extern void ExtractFilePath(const char* const path, char* dest);
- extern void ExtractFileBase(const char* const path, char* dest);
- extern void ExtractFileExtension(const char* const path, char* dest);
- extern short BigShort(short l);
- extern short LittleShort(short l);
- extern int BigLong(int l);
- extern int LittleLong(int l);
- extern float BigFloat(float l);
- extern float LittleFloat(float l);
- #endif
|