normalize includes: common

This commit is contained in:
brainiac 2025-12-18 00:40:31 -08:00 committed by Alex
parent c191ec02d4
commit 3d7101876f
39 changed files with 59 additions and 143 deletions

View File

@ -18,10 +18,13 @@
*
*/
#ifndef EQEMU_EQEMU_COMMAND_HANDLER_H
#define EQEMU_EQEMU_COMMAND_HANDLER_H
#pragma once
#include "argh.h"
#include "common/cli/argh.h"
#include <map>
#include <string>
#include <vector>
namespace EQEmuCommand {
@ -70,6 +73,3 @@ namespace EQEmuCommand {
char **argv
);
};
#endif //EQEMU_EQEMU_COMMAND_HANDLER_H

View File

@ -220,8 +220,8 @@ void set_exception_handler() {
}
#else
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <cstdlib>
#include <sys/wait.h>
#include <unistd.h>
#include <sys/fcntl.h>

View File

@ -60,17 +60,6 @@ struct VarCache_Struct {
class PTimerList;
#ifdef _WINDOWS
#if _MSC_VER > 1700 // greater than 2012 (2013+)
# define _ISNAN_(a) std::isnan(a)
#else
# include <float.h>
# define _ISNAN_(a) _isnan(a)
#endif
#else
# define _ISNAN_(a) std::isnan(a)
#endif
#define SQL(...) #__VA_ARGS__
class Database : public DBcore {

View File

@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "database.h"
#include "common/platform/inet.h"
#include "common/platform/platform"
#include "common/platform/platform.h"
#include "common/platform/win/include_windows.h"
#include "common/repositories/character_corpses_repository.h"
#include "common/repositories/data_buckets_repository.h"

View File

@ -5,24 +5,10 @@
#include "common/mysql_stmt.h"
#include "common/strings.h"
#include "common/timer.h"
#include "common/types.h"
#include "mysqld_error.h"
#include <fstream>
#include <iostream>
#include <string.h>
#ifdef _WINDOWS
#define snprintf _snprintf
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#include <process.h>
#include <winsock2.h>
#else
#include "common/unix.h"
#include <pthread.h>
#endif
#ifdef _EQDEBUG
#define DEBUG_MYSQL_QUERIES 0
#else

View File

@ -5,8 +5,6 @@
#include "common/types.h"
#include "mysql.h"
#include <string.h>
#include <mutex>
#define CR_SERVER_GONE_ERROR 2006

View File

@ -28,6 +28,8 @@
#include "common/platform.h"
#include <cstdio>
#include <iomanip>
#include <iostream>
EQPacket::EQPacket(EmuOpcode op, const unsigned char *buf, uint32 len)
: BasePacket(buf, len),

View File

@ -29,17 +29,15 @@
#include "common/strings.h"
#include "common/termcolor/rang.hpp"
#include <ctime>
#include <filesystem>
#include <iostream>
#include <string>
#include <sys/stat.h>
#include <time.h>
#ifdef _WINDOWS
#include <conio.h>
#include <direct.h>
#include <dos.h>
#include <iostream>
#include <process.h>
#include <windows.h>
#else

View File

@ -1,8 +1,10 @@
#pragma once
#include "common/platform/win/include_windows.h" // uv.h is going to include it so lets do it first.
#include "common/platform/win/include_windows.h" // uv.h is going to include it so let's do it first.
#include "uv.h" // FIXME: hide this
#include <cstring>
namespace EQ
{
class EventLoop

View File

@ -2,6 +2,7 @@
#include "event_loop.h"
#include <cstring>
#include <functional>
namespace EQ {

View File

@ -20,6 +20,7 @@
#include "file.h"
#include "common/platform/platform.h"
#include "fmt/format.h"
#include <filesystem>
@ -28,18 +29,6 @@
#include <sys/stat.h>
#include <vector>
#ifdef _WINDOWS
#include <direct.h>
#include <conio.h>
#include <iostream>
#include <dos.h>
#include <windows.h>
#include <process.h>
#else
#include <unistd.h>
#include <sys/stat.h>
#endif
namespace fs = std::filesystem;

View File

@ -21,7 +21,7 @@
#include "common/eqemu_exception.h"
#include "common/types.h"
#include <string.h>
#include <cstring>
namespace EQ {

View File

@ -21,7 +21,7 @@
#include "common/eqemu_exception.h"
#include "common/types.h"
#include <string.h>
#include <cstring>
namespace EQ {

View File

@ -272,7 +272,7 @@ inline const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *asn1) {
#include <brotli/encode.h>
#endif
#include "../strings.h"
#include "common/strings.h"
/*
* Declaration

View File

@ -24,7 +24,7 @@
#include "common/shareddb.h"
#include "common/strings.h"
#include <limits.h>
#include <climits>
int32 next_item_serial_number = 1;
std::unordered_set<uint64> guids{};

View File

@ -19,7 +19,7 @@
#include "light_source.h"
#include <string.h>
#include <cstring>
uint8 EQ::lightsource::TypeToLevel(uint8 light_type)
{

View File

@ -13,7 +13,7 @@
#include "common/strings.h"
#include "common/seperator.h"
#include <string.h> /* for memcpy() */
#include <cstring> /* for memcpy() */
MD5::MD5() {
memset(pMD5, 0, 16);

View File

@ -21,8 +21,8 @@
#include "common/types.h"
#include <cstring>
#include <sstream>
#include <string.h>
#include <string>
#include <type_traits>

View File

@ -4,13 +4,13 @@
#include "common/types.h"
#include "zlib.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <time.h>
std::map<int,std::string> DBFieldNames;

View File

@ -1,7 +1,7 @@
#pragma once
#include <map>
#include <stdio.h>
#include <cstdio>
#include <string>
#define ITEMFIELDCOUNT 116

View File

@ -18,69 +18,20 @@
#include "misc_functions.h"
#include "common/platform/inet.h"
#include "common/platform/platform.h"
#include "common/seperator.h"
#include "common/strings.h"
#include "common/timer.h"
#include "common/types.h"
#include <iomanip>
#include <iostream>
#include <string.h>
#include <time.h>
#include <ctime>
#ifdef _WINDOWS
#include <io.h>
#include <Windows.h>
#include <WinSock2.h>
#define snprintf _snprintf
#else
#include <netinet/in.h>
#include <sys/socket.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
#include <sys/types.h>
#include <sys/time.h>
#ifdef FREEBSD //Timothy Whitman - January 7, 2003
#include <sys/socket.h>
#include <netinet/in.h>
#endif
#ifndef _WINDOWS
#include <sys/stat.h>
#include <unistd.h>
#include <netdb.h>
#include <errno.h>
#endif
void CoutTimestamp(bool ms) {
time_t rawtime;
struct tm* gmt_t;
time(&rawtime);
gmt_t = gmtime(&rawtime);
struct timeval read_time;
gettimeofday(&read_time,0);
std::cout << (gmt_t->tm_year + 1900) << "/" << std::setw(2) << std::setfill('0') << (gmt_t->tm_mon + 1) << "/" << std::setw(2) << std::setfill('0') << gmt_t->tm_mday << " " << std::setw(2) << std::setfill('0') << gmt_t->tm_hour << ":" << std::setw(2) << std::setfill('0') << gmt_t->tm_min << ":" << std::setw(2) << std::setfill('0') << gmt_t->tm_sec;
if (ms)
std::cout << "." << std::setw(3) << std::setfill('0') << (read_time.tv_usec / 1000);
std::cout << " GMT";
}
int32 filesize(FILE* fp) {
#ifdef _WINDOWS
return _filelength(_fileno(fp));
#else
struct stat file_stat;
fstat(fileno(fp), &file_stat);
return (int32) file_stat.st_size;
/* uint32 tmp = 0;
while (!feof(fp)) {
fseek(fp, tmp++, SEEK_SET);
}
return tmp;*/
#endif
}
uint32 ResolveIP(const char* hostname, char* errbuf) {
#ifdef _WINDOWS
static InitWinsock ws;
@ -140,7 +91,6 @@ InitWinsock::InitWinsock() {
InitWinsock::~InitWinsock() {
WSACleanup();
}
#endif

View File

@ -20,10 +20,6 @@
#include "common/types.h"
#include <string>
#include <time.h>
#ifndef ERRBUF_SIZE
#define ERRBUF_SIZE 1024
#endif
@ -46,10 +42,9 @@
return; \
}
int32 filesize(FILE* fp);
uint32 ResolveIP(const char* hostname, char* errbuf = 0);
bool ParseAddress(const char* iAddress, uint32* oIP, uint16* oPort, char* errbuf = 0);
void CoutTimestamp(bool ms = true);
float EQ13toFloat(int d);
float EQ19toFloat(int d);
float EQHtoFloat(int d);

View File

@ -12,7 +12,6 @@
#include <list>
#include <map>
#include <memory>
#include <queue>
namespace EQ
{

View File

@ -21,9 +21,9 @@
#include "common/emu_opcodes.h"
#include "common/eqemu_logsys.h"
#include <cstdio>
#include <cstring>
#include <map>
#include <stdio.h>
#include <string>
OpcodeManager::OpcodeManager() {

View File

@ -20,10 +20,10 @@
#include "common/servertalk.h"
#include <cstdio>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <stdio.h>
void DumpPacketAscii(const uchar* buf, uint32 size, uint32 cols, uint32 skip) {
// Output as ASCII

View File

@ -22,9 +22,8 @@
#include "common/platform/inet.h"
#include "zlib.h"
#include <iomanip>
#include <cstring>
#include <iostream>
#include <string.h>
void EncryptProfilePacket(EQApplicationPacket* app) {
//EncryptProfilePacket(app->pBuffer, app->size);

View File

@ -4,11 +4,16 @@
#include "fmt/format.h"
// Lightweight, widely used
#include <algorithm>
#include <cassert>
#include <chrono>
#include <cstdint>
#include <iterator>
#include <limits>
#include <map>
#include <memory>
#include <random>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <vector>

View File

@ -20,6 +20,9 @@
#include "common/types.h"
#include <csignal>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
@ -28,14 +31,11 @@
#else
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#endif
ProcLauncher ProcLauncher::s_launcher;

View File

@ -19,6 +19,7 @@
#pragma once
#include "common/platform/platform.h"
#include "common/types.h"
#include <map>
#include <string>

View File

@ -24,8 +24,8 @@
#include "common/strings.h"
#include <algorithm>
#include <cctype>
#include <cstring>
#include <ctype.h>
static std::list<std::string> profanity_list;

View File

@ -19,7 +19,6 @@
#pragma once
#include <random>
#include <utility>
#include <algorithm>
#include <iterator>
#include <type_traits>

View File

@ -25,8 +25,8 @@
#include "common/types.h"
#include <stdlib.h>
#include <string.h>
#include <cstdlib>
#include <cstring>
class Seperator
{

View File

@ -3,6 +3,7 @@
#include <cassert>
#include <cstdint>
#include <cstring>
#include <string>
#include <utility>

View File

@ -5,8 +5,8 @@
#include "common/strings.h"
#include <chrono>
#include <ctime>
#include <iostream>
#include <time.h>
ServerEventScheduler::ServerEventScheduler()
{

View File

@ -2,7 +2,7 @@
#include "common/repositories/server_scheduled_events_repository.h"
#include <time.h>
#include <ctime>
#include <chrono>
namespace ServerEvents {

View File

@ -440,6 +440,7 @@ public:
uint32 destination;
};
#pragma pack(push)
#pragma pack(1)
struct SPackSendQueue {

View File

@ -21,7 +21,7 @@
#include "common/classes.h"
#include <string.h>
#include <cstring>
bool EQ::skills::IsTradeskill(SkillType skill)
{

View File

@ -19,6 +19,7 @@
#pragma once
#include <cstdint>
typedef uint8_t byte;
typedef uint8_t uint8;
typedef uint16_t uint16;
@ -44,7 +45,7 @@ typedef const char Const_char; //for perl XS
#ifdef _WINDOWS
#if (!defined(_MSC_VER) || (defined(_MSC_VER) && _MSC_VER < 1900))
#define snprintf _snprintf
#define snprintf _snprintf
#endif
#define strncasecmp _strnicmp
#define strcasecmp _stricmp

View File

@ -19,8 +19,8 @@
#include "unix.h"
#include <string.h>
#include <ctype.h>
#include <cctype>
#include <cstring>
void Sleep(unsigned int x) {
if (x > 0)