Convert to pragma once

This commit is contained in:
2026-02-25 01:58:19 -05:00
parent adead5149e
commit 4b81a0768a
35 changed files with 35 additions and 141 deletions

View File

@@ -107,8 +107,7 @@
//
///////////////////////////////////////////////////////////////////
#ifndef ANIMQUEUE_HPP
#define ANIMQUEUE_HPP
#pragma once
#include "wrap-set.hpp"
#include "wrap-string.hpp"
@@ -431,5 +430,4 @@ private:
static util::SharedStdString blankqueue_;
};
#endif // ANIMQUEUE_HPP

View File

@@ -1,5 +1,4 @@
#ifndef DEBUGCOLLECTOR_HPP
#define DEBUGCOLLECTOR_HPP
#pragma once
#include "wrap-vector.hpp"
#include "wrap-string.hpp"
@@ -47,5 +46,4 @@ public:
#define DebugHeader(dbc) if (((dbc)!=nullptr) && (dbc)->do_header()) ((dbc)->oss_)
#define DebugLine(dbc) if (((dbc)!=nullptr) && (dbc)->do_line()) ((dbc)->oss_)
#endif // DEBUGCOLLECTOR_HPP

View File

@@ -39,8 +39,7 @@
//
//////////////////////////////////////////////////////////////
#ifndef DRIVENENGINE_HPP
#define DRIVENENGINE_HPP
#pragma once
#include "wrap-string.hpp"
#include "wrap-vector.hpp"
@@ -325,6 +324,3 @@ struct DrivenEngineInitializerReg {
static DrivenEngineInitializer func;
DrivenEngineInitializerReg(DrivenEngineInitializer f);
};
#endif // DRIVENENGINE_HPP

View File

@@ -59,8 +59,7 @@
// data goes into the malloc heap. By the way, eng::ostringstream uses
// the eng::malloc heap.
//
#ifndef ENG_MALLOC_HPP
#define ENG_MALLOC_HPP
#pragma once
#include <cstddef>
#include <memory>
@@ -207,5 +206,3 @@ namespace eng {
}
} // namespace eng
#endif // ENG_MALLOC_HPP

View File

@@ -12,8 +12,7 @@
//
////////////////////////////////////////////////////////////////////////////////
#ifndef ENGINEWRAPPER_H
#define ENGINEWRAPPER_H
#pragma once
#include <cstdint>
#include <cstddef>
@@ -305,5 +304,3 @@ struct EngineWrapper {
//
void (*release)(EngineWrapper *w);
};
#endif // ENGINEWRAPPER_HPP

View File

@@ -10,8 +10,7 @@
//
/////////////////////////////////////////////////////////
#ifndef HTTP_HPP
#define HTTP_HPP
#pragma once
#include "eng-malloc.hpp"
#include "wrap-string.hpp"
@@ -454,5 +453,3 @@ public:
using HttpChannelMap = eng::map<int64_t, HttpChannel>;
using HttpChannelVec = eng::vector<HttpChannel>;
#endif // HTTP_HPP

View File

@@ -90,8 +90,7 @@
//
///////////////////////////////////////////////////////////////////
#ifndef IDALLOC_HPP
#define IDALLOC_HPP
#pragma once
#include "wrap-map.hpp"
#include "wrap-sstream.hpp"
@@ -219,5 +218,4 @@ private:
friend int lfn_unittests_idalloc(lua_State *L);
};
#endif // IDALLOC_HPP

View File

@@ -35,8 +35,7 @@
//
//////////////////////////////////////////////////////////////////////////
#ifndef INVOCATION_HPP
#define INVOCATION_HPP
#pragma once
#include "wrap-string.hpp"
#include "wrap-map.hpp"
@@ -72,6 +71,3 @@ using UniqueInvocation = std::unique_ptr<Invocation>;
class InvocationQueue : public eng::deque<Invocation> {
};
#endif // INVOCATION_HPP

View File

@@ -2,8 +2,7 @@
//
// See the doc(http.jsonencode) to read about limitations of the encoder.
//
#ifndef JSON_HPP
#define JSON_HPP
#pragma once
#include "luastack.hpp"
#include "wrap-string.hpp"
@@ -30,5 +29,4 @@ namespace json {
bool decode(LuaCoreStack &LS, LuaSlot out, std::string_view in);
}
#endif // JSON_HPP

View File

@@ -40,8 +40,7 @@
//
////////////////////////////////////////////////////////////////////
#ifndef KEYWORDS_HPP
#define KEYWORDS_HPP
#pragma once
#include "luastack.hpp"
@@ -88,5 +87,3 @@ public:
// Fetch the state pointer.
lua_State *state() const { return LS.state(); }
};
#endif // KEYWORDS_HPP

View File

@@ -1,4 +1 @@
#ifndef LPXCLIENT_HPP
#define LPXCLIENT_HPP
#endif // LPXCLIENT_HPP
#pragma once

View File

@@ -1,5 +1,2 @@
#ifndef LPXSERVER_HPP
#define LPXSERVER_HPP
#endif // LPXSERVER_HPP
#pragma once

View File

@@ -11,8 +11,7 @@
//
/////////////////////////////////////////////////////////////////////////////
#ifndef LUASNAP_HPP
#define LUASNAP_HPP
#pragma once
#include "streambuffer.hpp"
#include "luastack.hpp"
@@ -37,6 +36,3 @@ public:
//
void deserialize(StreamBuffer *sb);
};
#endif // LUASNAP_HPP

View File

@@ -5,8 +5,7 @@
//
/////////////////////////////////////////////////////////
#ifndef LUASTACK_HPP
#define LUASTACK_HPP
#pragma once
#include "util.hpp"
#include "wrap-string.hpp"
@@ -946,5 +945,3 @@ public:
#define LuaStringify(x) #x
#define LuaAssert(L, x) if (!(x)) { luaL_error((L), "Assert failed: %s (file %s line %d)", LuaStringify(x), __FILE__, __LINE__); }
#define LuaAssertStrEq(L, x, y) { eng::string _s1_(x); eng::string _s2_(y); if (_s1_ != _s2_) luaL_error((L), "Assert failed: value=%s (file %s line %d)", _s1_.c_str(), __FILE__, __LINE__); }
#endif // LUASTACK_HPP

View File

@@ -70,8 +70,7 @@
//
//////////////////////////////////////////////////////////////
#ifndef PLANEMAP_HPP
#define PLANEMAP_HPP
#pragma once
#include "wrap-vector.hpp"
#include "wrap-map.hpp"
@@ -256,6 +255,3 @@ private:
};
#endif // PLANEMAP_HPP

View File

@@ -16,8 +16,7 @@
//
//////////////////////////////////////////////////////////////////////////////////
#ifndef PPRINT_HPP
#define PPRINT_HPP
#pragma once
#include "luastack.hpp"
#include <ostream>
@@ -89,5 +88,3 @@ public:
friend class PrintMachine;
};
#endif // PPRINT_HPP

View File

@@ -74,8 +74,7 @@
////////////////////////////////////////////////////////////////////////////////
#ifndef PRINTBUFFER_HPP
#define PRINTBUFFER_HPP
#pragma once
#include "wrap-deque.hpp"
#include "wrap-string.hpp"
@@ -183,6 +182,3 @@ public:
Invocation invocation(int64_t actor_id);
};
#endif // PRINTBUFFER_HPP

View File

@@ -1,5 +1,4 @@
#ifndef SCHED_HPP
#define SCHED_HPP
#pragma once
#include "wrap-set.hpp"
@@ -44,5 +43,4 @@ public:
void deserialize(StreamBuffer *sb);
};
#endif // SCHED_HPP

View File

@@ -11,8 +11,7 @@
////////////////////////////////////////////////////////////
#ifndef SERIALIZELUA_HPP
#define SERIALIZELUA_HPP
#pragma once
#include "luastack.hpp"
#include "streambuffer.hpp"
@@ -36,5 +35,3 @@ eng::string serialize_lua(LuaCoreStack &LS0, LuaSlot val, StreamBuffer *sb);
// streambuffer is likely only partially consumed.
//
eng::string deserialize_lua(LuaCoreStack &LS0, LuaSlot val, StreamBuffer *sb);
#endif // SERIALIZELUA_HPP

View File

@@ -115,8 +115,7 @@
//
////////////////////////////////////////////////////////////
#ifndef SOURCE_HPP
#define SOURCE_HPP
#pragma once
#include "wrap-string.hpp"
@@ -213,6 +212,5 @@ public:
static void deserialize_source(util::LuaSourceVec *sv, StreamBuffer *sb);
};
#endif // SOURCE_HPP

View File

@@ -26,8 +26,7 @@
// slower than MD5.
//
#ifndef SPOOKYV2_HPP
#define SPOOKYV2_HPP
#pragma once
#include <cstddef>
#include <cstdint>
@@ -79,5 +78,3 @@ public:
return hash1;
}
};
#endif // SPOOKYV2_HPP

View File

@@ -199,8 +199,7 @@
//////////////////////////////////////////////////////////////
#ifndef STREAMBUFFER_HPP
#define STREAMBUFFER_HPP
#pragma once
#include "wrap-string.hpp"
#include "wrap-sstream.hpp"
@@ -279,5 +278,3 @@ public:
// Use a streambuffer as a lua_writer.
int lua_writer_into_streambuffer(lua_State *L, const void* bytes, size_t sz, void* sb);
#endif // STREAMBUFFER_HPP

View File

@@ -7,8 +7,7 @@
////////////////////////////////////////////////////////////
#ifndef TABLE_HPP
#define TABLE_HPP
#pragma once
#include "luastack.hpp"
@@ -24,6 +23,3 @@ bool table_equal(LuaCoreStack &LS0, LuaSlot tab1, LuaSlot tab2);
// the pairs. Return true if all keys were sortable.
//
bool table_getpairs(LuaCoreStack &LS0, LuaSlot tab, LuaSlot pairs, bool sort);
#endif // TABLE_HPP

View File

@@ -8,8 +8,7 @@
/////////////////////////////////////////////////////////////////
#ifndef TRACEBACK_HPP
#define TRACEBACK_HPP
#pragma once
#include "luastack.hpp"
@@ -29,5 +28,3 @@ int traceback_coroutine(lua_State *L);
// not allowed, and does an assert-fail in that case.
//
eng::string traceback_pcall(lua_State *L, int narg, int nret);
#endif // TRACEBACK_HPP

View File

@@ -13,8 +13,7 @@
//
///////////////////////////////////////////////////////////////////////
#ifndef UTIL_HPP
#define UTIL_HPP
#pragma once
#include "wrap-string.hpp"
#include "wrap-set.hpp"
@@ -556,5 +555,3 @@ inline std::ostream &operator<<(std::ostream &oss, const util::DXYZ &xyz) {
oss << xyz.x << "," << xyz.y << "," << xyz.z;
return oss;
}
#endif // UTIL_HPP

View File

@@ -1,6 +1,5 @@
#ifndef WORLD_HPP
#define WORLD_HPP
#pragma once
#include "wrap-set.hpp"
#include "wrap-unordered-map.hpp"
@@ -715,6 +714,3 @@ private:
};
using UniqueWorld = std::unique_ptr<World>;
#endif // WORLD_HPP