From e7e374f7c5692500037f4db847d24f7c00050ec4 Mon Sep 17 00:00:00 2001 From: Koncord Date: Tue, 15 Jan 2019 18:40:48 +0800 Subject: [PATCH] [Server] Fix order of CDECL --- apps/openmw-mp/Script/Functions/Actors.hpp | 34 ++++----- apps/openmw-mp/Script/Functions/Books.hpp | 4 +- apps/openmw-mp/Script/Functions/Cells.hpp | 10 +-- apps/openmw-mp/Script/Functions/CharClass.hpp | 6 +- apps/openmw-mp/Script/Functions/Dialogue.hpp | 4 +- apps/openmw-mp/Script/Functions/Factions.hpp | 6 +- apps/openmw-mp/Script/Functions/GUI.hpp | 4 +- apps/openmw-mp/Script/Functions/Items.hpp | 14 ++-- apps/openmw-mp/Script/Functions/Mechanics.hpp | 20 +++--- .../Script/Functions/Miscellaneous.hpp | 4 +- apps/openmw-mp/Script/Functions/Objects.hpp | 70 +++++++++---------- apps/openmw-mp/Script/Functions/Quests.hpp | 10 +-- .../Script/Functions/RecordsDynamic.hpp | 24 +++---- apps/openmw-mp/Script/Functions/Server.hpp | 8 +-- .../openmw-mp/Script/Functions/Shapeshift.hpp | 2 +- apps/openmw-mp/Script/Functions/Spells.hpp | 6 +- apps/openmw-mp/Script/Functions/Stats.hpp | 14 ++-- .../openmw-mp/Script/Functions/Worldstate.hpp | 4 +- 18 files changed, 122 insertions(+), 122 deletions(-) diff --git a/apps/openmw-mp/Script/Functions/Actors.hpp b/apps/openmw-mp/Script/Functions/Actors.hpp index df2d3dcc4..ba9c75edf 100644 --- a/apps/openmw-mp/Script/Functions/Actors.hpp +++ b/apps/openmw-mp/Script/Functions/Actors.hpp @@ -151,14 +151,14 @@ namespace ActorFunctions * * \return The number of indexes. */ - extern "C" unsigned int GetActorListSize() noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetActorListSize() noexcept; /** * \brief Get the action type used in the read actor list. * * \return The action type (0 for SET, 1 for ADD, 2 for REMOVE, 3 for REQUEST). */ - extern "C" unsigned char GetActorListAction() noexcept; + EXPORT_APIFUNCTION unsigned char CDECL GetActorListAction() noexcept; /** * \brief Get the cell description of the actor at a certain index in the read actor list. @@ -166,7 +166,7 @@ namespace ActorFunctions * \param index The index of the actor. * \return The cell description. */ - extern "C" const char *GetActorCell(unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetActorCell(unsigned int index) noexcept; /** * \brief Get the refId of the actor at a certain index in the read actor list. @@ -174,7 +174,7 @@ namespace ActorFunctions * \param index The index of the actor. * \return The refId. */ - extern "C" const char *GetActorRefId(unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetActorRefId(unsigned int index) noexcept; /** * \brief Get the refNum of the actor at a certain index in the read actor list. @@ -182,7 +182,7 @@ namespace ActorFunctions * \param index The index of the actor. * \return The refNum. */ - extern "C" unsigned int GetActorRefNum(unsigned int index) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetActorRefNum(unsigned int index) noexcept; /** * \brief Get the mpNum of the actor at a certain index in the read actor list. @@ -190,7 +190,7 @@ namespace ActorFunctions * \param index The index of the actor. * \return The mpNum. */ - extern "C" unsigned int GetActorMpNum(unsigned int index) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetActorMpNum(unsigned int index) noexcept; /** * \brief Get the X position of the actor at a certain index in the read actor list. @@ -320,7 +320,7 @@ namespace ActorFunctions * \param slot The slot of the equipment item. * \return The refId. */ - extern "C" const char *GetActorEquipmentItemRefId(unsigned int index, unsigned short slot) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetActorEquipmentItemRefId(unsigned int index, unsigned short slot) noexcept; /** * \brief Get the count of the item in a certain slot of the equipment of the actor at a @@ -374,7 +374,7 @@ namespace ActorFunctions * \param index The index of the actor. * \return The refId of the killer. */ - extern "C" const char *GetActorKillerRefId(unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetActorKillerRefId(unsigned int index) noexcept; /** * \brief Get the refNum of the actor killer of the actor at a certain index in the read actor list. @@ -382,7 +382,7 @@ namespace ActorFunctions * \param index The index of the actor. * \return The refNum of the killer. */ - extern "C" unsigned int GetActorKillerRefNum(unsigned int index) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetActorKillerRefNum(unsigned int index) noexcept; /** * \brief Get the mpNum of the actor killer of the actor at a certain index in the read actor list. @@ -390,7 +390,7 @@ namespace ActorFunctions * \param index The index of the actor. * \return The mpNum of the killer. */ - extern "C" unsigned int GetActorKillerMpNum(unsigned int index) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetActorKillerMpNum(unsigned int index) noexcept; /** * \brief Get the name of the actor killer of the actor at a certain index in the read actor list. @@ -398,7 +398,7 @@ namespace ActorFunctions * \param index The index of the actor. * \return The name of the killer. */ - extern "C" const char *GetActorKillerName(unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetActorKillerName(unsigned int index) noexcept; /** * \brief Check whether there is any positional data for the actor at a certain index in @@ -766,12 +766,12 @@ namespace ActorFunctions // All methods below are deprecated versions of methods from above - extern "C" void ReadLastActorList() noexcept; - extern "C" void InitializeActorList(unsigned short pid) noexcept; - extern "C" void CopyLastActorListToStore() noexcept; - extern "C" unsigned int GetActorRefNumIndex(unsigned int index) noexcept; - extern "C" unsigned int GetActorKillerRefNumIndex(unsigned int index) noexcept; - extern "C" void SetActorRefNumIndex(int refNum) noexcept; + EXPORT_APIFUNCTION void CDECL ReadLastActorList() noexcept; + EXPORT_APIFUNCTION void CDECL InitializeActorList(unsigned short pid) noexcept; + EXPORT_APIFUNCTION void CDECL CopyLastActorListToStore() noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetActorRefNumIndex(unsigned int index) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetActorKillerRefNumIndex(unsigned int index) noexcept; + EXPORT_APIFUNCTION void CDECL SetActorRefNumIndex(int refNum) noexcept; } diff --git a/apps/openmw-mp/Script/Functions/Books.hpp b/apps/openmw-mp/Script/Functions/Books.hpp index c28148947..52de03352 100644 --- a/apps/openmw-mp/Script/Functions/Books.hpp +++ b/apps/openmw-mp/Script/Functions/Books.hpp @@ -33,7 +33,7 @@ namespace BookFunctions * \param pid The player ID whose book changes should be used. * \return The number of indexes. */ - extern "C" unsigned int GetBookChangesSize(unsigned short pid) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetBookChangesSize(unsigned short pid) noexcept; /** * \brief Add a new book to the book changes for a player. @@ -51,7 +51,7 @@ namespace BookFunctions * \param index The index of the book. * \return The bookId. */ - extern "C" const char *GetBookId(unsigned short pid, unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetBookId(unsigned short pid, unsigned int index) noexcept; /** * \brief Send a PlayerBook packet with a player's recorded book changes. diff --git a/apps/openmw-mp/Script/Functions/Cells.hpp b/apps/openmw-mp/Script/Functions/Cells.hpp index 0726c7cd3..2dc24dabc 100644 --- a/apps/openmw-mp/Script/Functions/Cells.hpp +++ b/apps/openmw-mp/Script/Functions/Cells.hpp @@ -31,7 +31,7 @@ namespace CellFunctions * \param pid The player ID whose cell state changes should be used. * \return The number of indexes. */ - extern "C" unsigned int GetCellStateChangesSize(unsigned short pid) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetCellStateChangesSize(unsigned short pid) noexcept; /** * \brief Get the cell state type at a certain index in a player's latest cell state changes. @@ -40,7 +40,7 @@ namespace CellFunctions * \param index The index of the cell state. * \return The cell state type (0 for LOAD, 1 for UNLOAD). */ - extern "C" unsigned int GetCellStateType(unsigned short pid, unsigned int index) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetCellStateType(unsigned short pid, unsigned int index) noexcept; /** * \brief Get the cell description at a certain index in a player's latest cell state changes. @@ -49,7 +49,7 @@ namespace CellFunctions * \param index The index of the cell state. * \return The cell description. */ - extern "C" const char *GetCellStateDescription(unsigned short pid, unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetCellStateDescription(unsigned short pid, unsigned int index) noexcept; /** * \brief Get the cell description of a player's cell. @@ -57,7 +57,7 @@ namespace CellFunctions * \param pid The player ID. * \return The cell description. */ - extern "C" const char *GetCell(unsigned short pid) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetCell(unsigned short pid) noexcept; /** * \brief Get the X coordinate of the player's exterior cell. @@ -91,7 +91,7 @@ namespace CellFunctions * \param pid The player ID. * \return The region. */ - extern "C" const char *GetRegion(unsigned short pid) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetRegion(unsigned short pid) noexcept; /** * \brief Check whether the player's last cell change has involved a region change. diff --git a/apps/openmw-mp/Script/Functions/CharClass.hpp b/apps/openmw-mp/Script/Functions/CharClass.hpp index d11203dd1..b028de378 100644 --- a/apps/openmw-mp/Script/Functions/CharClass.hpp +++ b/apps/openmw-mp/Script/Functions/CharClass.hpp @@ -36,7 +36,7 @@ namespace CharClassFunctions * \param pid The player ID. * \return The ID of the default class. */ - extern "C" const char *GetDefaultClass(unsigned short pid) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetDefaultClass(unsigned short pid) noexcept; /** * \brief Get the name of the custom class used by a player. @@ -44,7 +44,7 @@ namespace CharClassFunctions * \param pid The player ID. * \return The name of the custom class. */ - extern "C" const char *GetClassName(unsigned short pid) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetClassName(unsigned short pid) noexcept; /** * \brief Get the description of the custom class used by a player. @@ -52,7 +52,7 @@ namespace CharClassFunctions * \param pid The player ID. * \return The description of the custom class. */ - extern "C" const char *GetClassDesc(unsigned short pid) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetClassDesc(unsigned short pid) noexcept; /** * \brief Get the ID of one of the two major attributes of a custom class used by a player. diff --git a/apps/openmw-mp/Script/Functions/Dialogue.hpp b/apps/openmw-mp/Script/Functions/Dialogue.hpp index ace52e7ca..06e77056d 100644 --- a/apps/openmw-mp/Script/Functions/Dialogue.hpp +++ b/apps/openmw-mp/Script/Functions/Dialogue.hpp @@ -35,7 +35,7 @@ namespace DialogueFunctions * \param pid The player ID whose topic changes should be used. * \return The number of indexes. */ - extern "C" unsigned int GetTopicChangesSize(unsigned short pid) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetTopicChangesSize(unsigned short pid) noexcept; /** * \brief Add a new topic to the topic changes for a player. @@ -53,7 +53,7 @@ namespace DialogueFunctions * \param index The index of the topic. * \return The topicId. */ - extern "C" const char *GetTopicId(unsigned short pid, unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetTopicId(unsigned short pid, unsigned int index) noexcept; /** * \brief Send a PlayerTopic packet with a player's recorded topic changes. diff --git a/apps/openmw-mp/Script/Functions/Factions.hpp b/apps/openmw-mp/Script/Functions/Factions.hpp index 2b0815918..1e6c5a7e5 100644 --- a/apps/openmw-mp/Script/Functions/Factions.hpp +++ b/apps/openmw-mp/Script/Functions/Factions.hpp @@ -42,7 +42,7 @@ namespace FactionFunctions * \param pid The player ID whose faction changes should be used. * \return The number of indexes. */ - extern "C" unsigned int GetFactionChangesSize(unsigned short pid) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetFactionChangesSize(unsigned short pid) noexcept; /** * \brief Get the action type used in a player's latest faction changes. @@ -50,7 +50,7 @@ namespace FactionFunctions * \param pid The player ID whose faction changes should be used. * \return The action type (0 for RANK, 1 for EXPULSION, 2 for REPUTATION). */ - extern "C" unsigned char GetFactionChangesAction(unsigned short pid) noexcept; + EXPORT_APIFUNCTION unsigned char CDECL GetFactionChangesAction(unsigned short pid) noexcept; /** * \brief Get the factionId at a certain index in a player's latest faction changes. @@ -59,7 +59,7 @@ namespace FactionFunctions * \param index The index of the faction. * \return The factionId. */ - extern "C" const char *GetFactionId(unsigned short pid, unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetFactionId(unsigned short pid, unsigned int index) noexcept; /** * \brief Get the rank at a certain index in a player's latest faction changes. diff --git a/apps/openmw-mp/Script/Functions/GUI.hpp b/apps/openmw-mp/Script/Functions/GUI.hpp index eec1da96f..4fb787125 100644 --- a/apps/openmw-mp/Script/Functions/GUI.hpp +++ b/apps/openmw-mp/Script/Functions/GUI.hpp @@ -107,7 +107,7 @@ namespace GUIFunctions * \param pid The player ID whose quick key changes should be used. * \return The number of indexes. */ - extern "C" unsigned int GetQuickKeyChangesSize(unsigned short pid) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetQuickKeyChangesSize(unsigned short pid) noexcept; /** * \brief Add a new quick key to the quick key changes for a player. @@ -145,7 +145,7 @@ namespace GUIFunctions * \param index The index of the quick key in the quick key changes vector. * \return The itemId. */ - extern "C" const char *GetQuickKeyItemId(unsigned short pid, unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetQuickKeyItemId(unsigned short pid, unsigned int index) noexcept; /** * \brief Send a PlayerQuickKeys packet with a player's recorded quick key changes. diff --git a/apps/openmw-mp/Script/Functions/Items.hpp b/apps/openmw-mp/Script/Functions/Items.hpp index 042d1c2c7..dfa085f1d 100644 --- a/apps/openmw-mp/Script/Functions/Items.hpp +++ b/apps/openmw-mp/Script/Functions/Items.hpp @@ -68,7 +68,7 @@ namespace ItemFunctions * \param pid The player ID whose inventory changes should be used. * \return The number of indexes. */ - extern "C" unsigned int GetInventoryChangesSize(unsigned short pid) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetInventoryChangesSize(unsigned short pid) noexcept; /** * \brief Get the action type used in a player's latest inventory changes. @@ -76,7 +76,7 @@ namespace ItemFunctions * \param pid The player ID whose inventory changes should be used. * \return The action type (0 for SET, 1 for ADD, 2 for REMOVE). */ - extern "C" unsigned int GetInventoryChangesAction(unsigned short pid) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetInventoryChangesAction(unsigned short pid) noexcept; /** * \brief Set the action type in a player's inventory changes. @@ -140,7 +140,7 @@ namespace ItemFunctions * \param slot The slot of the equipment item. * \return The refId. */ - extern "C" const char *GetEquipmentItemRefId(unsigned short pid, unsigned short slot) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetEquipmentItemRefId(unsigned short pid, unsigned short slot) noexcept; /** * \brief Get the count of the item in a certain slot of the equipment of a player. @@ -178,7 +178,7 @@ namespace ItemFunctions * \param index The index of the inventory item. * \return The refId. */ - extern "C" const char *GetInventoryItemRefId(unsigned short pid, unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetInventoryItemRefId(unsigned short pid, unsigned int index) noexcept; /** * \brief Get the count of the item at a certain index in a player's latest inventory @@ -218,7 +218,7 @@ namespace ItemFunctions * \param index The index of the inventory item. * \return The soul. */ - extern "C" const char *GetInventoryItemSoul(unsigned short pid, unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetInventoryItemSoul(unsigned short pid, unsigned int index) noexcept; /** * \brief Get the refId of the item last used by a player. @@ -226,7 +226,7 @@ namespace ItemFunctions * \param pid The player ID. * \return The refId. */ - extern "C" const char *GetUsedItemRefId(unsigned short pid) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetUsedItemRefId(unsigned short pid) noexcept; /** * \brief Get the count of the item last used by a player. @@ -258,7 +258,7 @@ namespace ItemFunctions * \param pid The player ID. * \return The soul. */ - extern "C" const char *GetUsedItemSoul(unsigned short pid) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetUsedItemSoul(unsigned short pid) noexcept; /** * \brief Send a PlayerEquipment packet with a player's equipment. diff --git a/apps/openmw-mp/Script/Functions/Mechanics.hpp b/apps/openmw-mp/Script/Functions/Mechanics.hpp index 1a95765f3..b9f646cbb 100644 --- a/apps/openmw-mp/Script/Functions/Mechanics.hpp +++ b/apps/openmw-mp/Script/Functions/Mechanics.hpp @@ -46,7 +46,7 @@ namespace MechanicsFunctions * \param pid The player ID. * \return The type. */ - extern "C" unsigned char GetMiscellaneousChangeType(unsigned short pid) noexcept; + EXPORT_APIFUNCTION unsigned char CDECL GetMiscellaneousChangeType(unsigned short pid) noexcept; /** * \brief Get the cell description of a player's Mark cell. @@ -54,7 +54,7 @@ namespace MechanicsFunctions * \param pid The player ID. * \return The cell description. */ - extern "C" const char *GetMarkCell(unsigned short pid) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetMarkCell(unsigned short pid) noexcept; /** * \brief Get the X position of a player's Mark. @@ -102,7 +102,7 @@ namespace MechanicsFunctions * \param pid The player ID. * \return The spell ID. */ - extern "C" const char *GetSelectedSpellId(unsigned short pid) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetSelectedSpellId(unsigned short pid) noexcept; /** * \brief Check whether the killer of a certain player is also a player. @@ -126,7 +126,7 @@ namespace MechanicsFunctions * \param pid The player ID of the killed player. * \return The refId of the killer. */ - extern "C" const char *GetPlayerKillerRefId(unsigned short pid) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetPlayerKillerRefId(unsigned short pid) noexcept; /** * \brief Get the refNum of the actor killer of a certain player. @@ -134,7 +134,7 @@ namespace MechanicsFunctions * \param pid The player ID of the killed player. * \return The refNum of the killer. */ - extern "C" unsigned int GetPlayerKillerRefNum(unsigned short pid) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetPlayerKillerRefNum(unsigned short pid) noexcept; /** * \brief Get the mpNum of the actor killer of a certain player. @@ -142,7 +142,7 @@ namespace MechanicsFunctions * \param pid The player ID of the killed player. * \return The mpNum of the killer. */ - extern "C" unsigned int GetPlayerKillerMpNum(unsigned short pid) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetPlayerKillerMpNum(unsigned short pid) noexcept; /** * \brief Get the name of the actor killer of a certain player. @@ -150,7 +150,7 @@ namespace MechanicsFunctions * \param pid The player ID of the killed player. * \return The name of the killer. */ - extern "C" const char *GetPlayerKillerName(unsigned short pid) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetPlayerKillerName(unsigned short pid) noexcept; /** * \brief Get the draw state of a player (0 for nothing, 1 for drawn weapon, @@ -159,7 +159,7 @@ namespace MechanicsFunctions * \param pid The player ID. * \return The draw state. */ - extern "C" unsigned int GetDrawState(unsigned short pid) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetDrawState(unsigned short pid) noexcept; /** * \brief Get the sneak state of a player. @@ -276,8 +276,8 @@ namespace MechanicsFunctions // All methods below are deprecated versions of methods from above - extern "C" const char *GetDeathReason(unsigned short pid) noexcept; - extern "C" unsigned int GetPlayerKillerRefNumIndex(unsigned short pid) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetDeathReason(unsigned short pid) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetPlayerKillerRefNumIndex(unsigned short pid) noexcept; } #endif //OPENMW_MECHANICSAPI_HPP diff --git a/apps/openmw-mp/Script/Functions/Miscellaneous.hpp b/apps/openmw-mp/Script/Functions/Miscellaneous.hpp index aec83d810..468355cb8 100644 --- a/apps/openmw-mp/Script/Functions/Miscellaneous.hpp +++ b/apps/openmw-mp/Script/Functions/Miscellaneous.hpp @@ -36,7 +36,7 @@ namespace MiscellaneousFunctions * * \return The filename that matches. */ - extern "C" const char *GetCaseInsensitiveFilename(const char *folderPath, const char *filename) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetCaseInsensitiveFilename(const char *folderPath, const char *filename) noexcept; /** * \brief Get the last player ID currently connected to the server. @@ -46,7 +46,7 @@ namespace MiscellaneousFunctions * * \return The player ID. */ - extern "C" unsigned int GetLastPlayerId() noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetLastPlayerId() noexcept; /** * \brief Get the current (latest) mpNum generated by the server. diff --git a/apps/openmw-mp/Script/Functions/Objects.hpp b/apps/openmw-mp/Script/Functions/Objects.hpp index a49e2f28b..622113a12 100644 --- a/apps/openmw-mp/Script/Functions/Objects.hpp +++ b/apps/openmw-mp/Script/Functions/Objects.hpp @@ -174,7 +174,7 @@ namespace ObjectFunctions * * \return The number of indexes. */ - extern "C" unsigned int GetObjectListSize() noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetObjectListSize() noexcept; /** * \brief Get the origin of the read object list. @@ -183,7 +183,7 @@ namespace ObjectFunctions * CLIENT_DIALOGUE, 3 for CLIENT_SCRIPT_LOCAL, 4 for CLIENT_SCRIPT_GLOBAL, * 5 for SERVER_SCRIPT). */ - extern "C" unsigned char GetObjectListOrigin() noexcept; + EXPORT_APIFUNCTION unsigned char CDECL GetObjectListOrigin() noexcept; /** * \brief Get the client script that the read object list originated from. @@ -192,21 +192,21 @@ namespace ObjectFunctions * * \return The ID of the client script. */ - extern "C" const char *GetObjectListClientScript() noexcept; + EXPORT_APIFUNCTION const char *CDECL GetObjectListClientScript() noexcept; /** * \brief Get the action type used in the read object list. * * \return The action type (0 for SET, 1 for ADD, 2 for REMOVE, 3 for REQUEST). */ - extern "C" unsigned char GetObjectListAction() noexcept; + EXPORT_APIFUNCTION unsigned char CDECL GetObjectListAction() noexcept; /** * \brief Get the container subaction type used in the read object list. * * \return The action type (0 for NONE, 1 for DRAG, 2 for DROP, 3 for TAKE_ALL). */ - extern "C" unsigned char GetObjectListContainerSubAction() noexcept; + EXPORT_APIFUNCTION unsigned char CDECL GetObjectListContainerSubAction() noexcept; /** * \brief Check whether the object at a certain index in the read object list is a @@ -239,7 +239,7 @@ namespace ObjectFunctions * \param index The index of the object. * \return The refId. */ - extern "C" const char *GetObjectRefId(unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetObjectRefId(unsigned int index) noexcept; /** * \brief Get the refNum of the object at a certain index in the read object list. @@ -247,7 +247,7 @@ namespace ObjectFunctions * \param index The index of the object. * \return The refNum. */ - extern "C" unsigned int GetObjectRefNum(unsigned int index) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetObjectRefNum(unsigned int index) noexcept; /** * \brief Get the mpNum of the object at a certain index in the read object list. @@ -255,7 +255,7 @@ namespace ObjectFunctions * \param index The index of the object. * \return The mpNum. */ - extern "C" unsigned int GetObjectMpNum(unsigned int index) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetObjectMpNum(unsigned int index) noexcept; /** * \brief Get the count of the object at a certain index in the read object list. @@ -287,7 +287,7 @@ namespace ObjectFunctions * \param index The index of the object. * \return The soul. */ - extern "C" const char *GetObjectSoul(unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetObjectSoul(unsigned int index) noexcept; /** * \brief Get the gold value of the object at a certain index in the read object list. @@ -356,7 +356,7 @@ namespace ObjectFunctions * \param index The index of the object. * \return The refId of the activating actor. */ - extern "C" const char *GetObjectActivatingRefId(unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetObjectActivatingRefId(unsigned int index) noexcept; /** * \brief Get the refNum of the actor activating the object at a certain index in the read @@ -365,7 +365,7 @@ namespace ObjectFunctions * \param index The index of the object. * \return The refNum of the activating actor. */ - extern "C" unsigned int GetObjectActivatingRefNum(unsigned int index) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetObjectActivatingRefNum(unsigned int index) noexcept; /** * \brief Get the mpNum of the actor activating the object at a certain index in the read @@ -374,7 +374,7 @@ namespace ObjectFunctions * \param index The index of the object. * \return The mpNum of the activating actor. */ - extern "C" unsigned int GetObjectActivatingMpNum(unsigned int index) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetObjectActivatingMpNum(unsigned int index) noexcept; /** * \brief Get the name of the actor activating the object at a certain index in the read @@ -383,7 +383,7 @@ namespace ObjectFunctions * \param index The index of the object. * \return The name of the activating actor. */ - extern "C" const char *GetObjectActivatingName(unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetObjectActivatingName(unsigned int index) noexcept; /** * \brief Check whether the object at a certain index in the read object list is a @@ -432,7 +432,7 @@ namespace ObjectFunctions * \param index The index of the object. * \return The refId of the summoner. */ - extern "C" const char *GetObjectSummonerRefId(unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetObjectSummonerRefId(unsigned int index) noexcept; /** * \brief Get the refNum of the actor summoner of the object at a certain index in the read object @@ -441,7 +441,7 @@ namespace ObjectFunctions * \param index The index of the object. * \return The refNum of the summoner. */ - extern "C" unsigned int GetObjectSummonerRefNum(unsigned int index) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetObjectSummonerRefNum(unsigned int index) noexcept; /** * \brief Get the mpNum of the actor summoner of the object at a certain index in the read object list. @@ -449,7 +449,7 @@ namespace ObjectFunctions * \param index The index of the object. * \return The mpNum of the summoner. */ - extern "C" unsigned int GetObjectSummonerMpNum(unsigned int index) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetObjectSummonerMpNum(unsigned int index) noexcept; /** * \brief Get the X position of the object at a certain index in the read object list. @@ -504,7 +504,7 @@ namespace ObjectFunctions * * \return The videoFilename. */ - extern "C" const char *GetVideoFilename(unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetVideoFilename(unsigned int index) noexcept; /** * \brief Get the number of container item indexes of the object at a certain index in the @@ -513,7 +513,7 @@ namespace ObjectFunctions * \param index The index of the object. * \return The number of container item indexes. */ - extern "C" unsigned int GetContainerChangesSize(unsigned int objectIndex) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetContainerChangesSize(unsigned int objectIndex) noexcept; /** * \brief Get the refId of the container item at a certain itemIndex in the container changes @@ -523,7 +523,7 @@ namespace ObjectFunctions * \param itemIndex The index of the container item. * \return The refId. */ - extern "C" const char *GetContainerItemRefId(unsigned int objectIndex, unsigned int itemIndex) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetContainerItemRefId(unsigned int objectIndex, unsigned int itemIndex) noexcept; /** * \brief Get the item count of the container item at a certain itemIndex in the container @@ -563,7 +563,7 @@ namespace ObjectFunctions * \param itemIndex The index of the container item. * \return The soul. */ - extern "C" const char *GetContainerItemSoul(unsigned int objectIndex, unsigned int itemIndex) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetContainerItemSoul(unsigned int objectIndex, unsigned int itemIndex) noexcept; /** * \brief Get the action count of the container item at a certain itemIndex in the container @@ -1069,21 +1069,21 @@ namespace ObjectFunctions // All methods below are deprecated versions of methods from above - extern "C" void ReadLastObjectList() noexcept; - extern "C" void ReadLastEvent() noexcept; - extern "C" void InitializeObjectList(unsigned short pid) noexcept; - extern "C" void InitializeEvent(unsigned short pid) noexcept; - extern "C" void CopyLastObjectListToStore() noexcept; - extern "C" unsigned int GetObjectChangesSize() noexcept; - extern "C" unsigned char GetEventAction() noexcept; - extern "C" unsigned char GetEventContainerSubAction() noexcept; - extern "C" unsigned int GetObjectRefNumIndex(unsigned int index) noexcept; - extern "C" unsigned int GetObjectSummonerRefNumIndex(unsigned int index) noexcept; - extern "C" void SetEventCell(const char* cellDescription) noexcept; - extern "C" void SetEventAction(unsigned char action) noexcept; - extern "C" void SetEventConsoleCommand(const char* consoleCommand) noexcept; - extern "C" void SetObjectRefNumIndex(int refNum) noexcept; - extern "C" void AddWorldObject() noexcept; + EXPORT_APIFUNCTION void CDECL ReadLastObjectList() noexcept; + EXPORT_APIFUNCTION void CDECL ReadLastEvent() noexcept; + EXPORT_APIFUNCTION void CDECL InitializeObjectList(unsigned short pid) noexcept; + EXPORT_APIFUNCTION void CDECL InitializeEvent(unsigned short pid) noexcept; + EXPORT_APIFUNCTION void CDECL CopyLastObjectListToStore() noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetObjectChangesSize() noexcept; + EXPORT_APIFUNCTION unsigned char CDECL GetEventAction() noexcept; + EXPORT_APIFUNCTION unsigned char CDECL GetEventContainerSubAction() noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetObjectRefNumIndex(unsigned int index) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetObjectSummonerRefNumIndex(unsigned int index) noexcept; + EXPORT_APIFUNCTION void CDECL SetEventCell(const char* cellDescription) noexcept; + EXPORT_APIFUNCTION void CDECL SetEventAction(unsigned char action) noexcept; + EXPORT_APIFUNCTION void CDECL SetEventConsoleCommand(const char* consoleCommand) noexcept; + EXPORT_APIFUNCTION void CDECL SetObjectRefNumIndex(int refNum) noexcept; + EXPORT_APIFUNCTION void CDECL AddWorldObject() noexcept; } diff --git a/apps/openmw-mp/Script/Functions/Quests.hpp b/apps/openmw-mp/Script/Functions/Quests.hpp index 583f80922..5ff8c3bbd 100644 --- a/apps/openmw-mp/Script/Functions/Quests.hpp +++ b/apps/openmw-mp/Script/Functions/Quests.hpp @@ -59,7 +59,7 @@ namespace QuestFunctions * \param pid The player ID whose journal changes should be used. * \return The number of indexes. */ - extern "C" unsigned int GetJournalChangesSize(unsigned short pid) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetJournalChangesSize(unsigned short pid) noexcept; /** * \brief Get the number of indexes in a player's latest kill count changes. @@ -67,7 +67,7 @@ namespace QuestFunctions * \param pid The player ID whose kill count changes should be used. * \return The number of indexes. */ - extern "C" unsigned int GetKillChangesSize(unsigned short pid) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetKillChangesSize(unsigned short pid) noexcept; /** * \brief Add a new journal item of type ENTRY to the journal changes for a player, @@ -133,7 +133,7 @@ namespace QuestFunctions * \param index The index of the journalItem. * \return The quest. */ - extern "C" const char *GetJournalItemQuest(unsigned short pid, unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetJournalItemQuest(unsigned short pid, unsigned int index) noexcept; /** * \brief Get the quest index at a certain index in a player's latest journal changes. @@ -162,7 +162,7 @@ namespace QuestFunctions * \param index The index of the journalItem. * \return The actor refId. */ - extern "C" const char *GetJournalItemActorRefId(unsigned short pid, unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetJournalItemActorRefId(unsigned short pid, unsigned int index) noexcept; /** * \brief Get the refId at a certain index in a player's latest kill count changes. @@ -171,7 +171,7 @@ namespace QuestFunctions * \param index The index of the kill count. * \return The refId. */ - extern "C" const char *GetKillRefId(unsigned short pid, unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetKillRefId(unsigned short pid, unsigned int index) noexcept; /** * \brief Get the number of kills at a certain index in a player's latest kill count changes. diff --git a/apps/openmw-mp/Script/Functions/RecordsDynamic.hpp b/apps/openmw-mp/Script/Functions/RecordsDynamic.hpp index e33624f3d..3fab53f0a 100644 --- a/apps/openmw-mp/Script/Functions/RecordsDynamic.hpp +++ b/apps/openmw-mp/Script/Functions/RecordsDynamic.hpp @@ -125,14 +125,14 @@ namespace RecordsDynamicFunctions * \return The type of records (0 for SPELL, 1 for POTION, 2 for ENCHANTMENT, * 3 for NPC). */ - extern "C" unsigned short GetRecordType() noexcept; + EXPORT_APIFUNCTION unsigned short CDECL GetRecordType() noexcept; /** * \brief Get the number of records in the read worldstate's dynamic records. * * \return The number of records. */ - extern "C" unsigned int GetRecordCount() noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetRecordCount() noexcept; /** * \brief Get the number of effects for the record at a certain index in the read @@ -141,7 +141,7 @@ namespace RecordsDynamicFunctions * \param recordIndex The index of the record. * \return The number of effects. */ - extern "C" unsigned int GetRecordEffectCount(unsigned int recordIndex) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetRecordEffectCount(unsigned int recordIndex) noexcept; /** * \brief Get the id of the record at a certain index in the read worldstate's @@ -150,7 +150,7 @@ namespace RecordsDynamicFunctions * \param index The index of the record. * \return The id of the record. */ - extern "C" const char *GetRecordId(unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetRecordId(unsigned int index) noexcept; /** * \brief Get the base id (i.e. the id this record should inherit default @@ -160,7 +160,7 @@ namespace RecordsDynamicFunctions * \param index The index of the record. * \return The base id of the record. */ - extern "C" const char *GetRecordBaseId(unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetRecordBaseId(unsigned int index) noexcept; /** * \brief Get the subtype of the record at a certain index in the read worldstate's @@ -178,7 +178,7 @@ namespace RecordsDynamicFunctions * \param index The index of the record. * \return The name of the record. */ - extern "C" const char *GetRecordName(unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetRecordName(unsigned int index) noexcept; /** * \brief Get the model of the record at a certain index in the read worldstate's @@ -187,7 +187,7 @@ namespace RecordsDynamicFunctions * \param index The index of the record. * \return The model of the record. */ - extern "C" const char *GetRecordModel(unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetRecordModel(unsigned int index) noexcept; /** * \brief Get the icon of the record at a certain index in the read worldstate's @@ -196,7 +196,7 @@ namespace RecordsDynamicFunctions * \param index The index of the record. * \return The icon of the record. */ - extern "C" const char *GetRecordIcon(unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetRecordIcon(unsigned int index) noexcept; /** * \brief Get the script of the record at a certain index in the read worldstate's @@ -205,7 +205,7 @@ namespace RecordsDynamicFunctions * \param index The index of the record. * \return The script of the record. */ - extern "C" const char *GetRecordScript(unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetRecordScript(unsigned int index) noexcept; /** * \brief Get the enchantment id of the record at a certain index in the read @@ -214,7 +214,7 @@ namespace RecordsDynamicFunctions * \param index The index of the record. * \return The enchantment id of the record. */ - extern "C" const char *GetRecordEnchantmentId(unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetRecordEnchantmentId(unsigned int index) noexcept; /** * \brief Get the enchantment charge of the record at a certain index in @@ -287,7 +287,7 @@ namespace RecordsDynamicFunctions * \param effectIndex The index of the effect. * \return The ID of the effect. */ - extern "C" unsigned int GetRecordEffectId(unsigned int recordIndex, unsigned int effectIndex) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetRecordEffectId(unsigned int recordIndex, unsigned int effectIndex) noexcept; /** * \brief Get the ID of the attribute modified by the effect at a certain index in the @@ -317,7 +317,7 @@ namespace RecordsDynamicFunctions * \param effectIndex The index of the effect. * \return The range of the effect. */ - extern "C" unsigned int GetRecordEffectRangeType(unsigned int recordIndex, unsigned int effectIndex) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetRecordEffectRangeType(unsigned int recordIndex, unsigned int effectIndex) noexcept; /** * \brief Get the area of the effect at a certain index in the read worldstate's current diff --git a/apps/openmw-mp/Script/Functions/Server.hpp b/apps/openmw-mp/Script/Functions/Server.hpp index d3a04d559..d52f3a910 100644 --- a/apps/openmw-mp/Script/Functions/Server.hpp +++ b/apps/openmw-mp/Script/Functions/Server.hpp @@ -89,14 +89,14 @@ namespace ServerFunctions * * \return The server version. */ - extern "C" const char *GetServerVersion() noexcept; + EXPORT_APIFUNCTION const char *CDECL GetServerVersion() noexcept; /** * \brief Get the protocol version of the server. * * \return The protocol version. */ - extern "C" const char *GetProtocolVersion() noexcept; + EXPORT_APIFUNCTION const char *CDECL GetProtocolVersion() noexcept; /** * \brief Get the average ping of a certain player. @@ -119,14 +119,14 @@ namespace ServerFunctions * * \return Port */ - extern "C" unsigned short GetPort() noexcept; + EXPORT_APIFUNCTION unsigned short CDECL GetPort() noexcept; /** * \brief Get the maximum number of players. * * \return Max players */ - extern "C" unsigned int GetMaxPlayers() noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetMaxPlayers() noexcept; /** * \brief Checking if the server requires a password to connect. diff --git a/apps/openmw-mp/Script/Functions/Shapeshift.hpp b/apps/openmw-mp/Script/Functions/Shapeshift.hpp index 892e18642..048668af5 100644 --- a/apps/openmw-mp/Script/Functions/Shapeshift.hpp +++ b/apps/openmw-mp/Script/Functions/Shapeshift.hpp @@ -42,7 +42,7 @@ namespace ShapeshiftFunctions * \param pid The player ID. * \return The creature refId. */ - extern "C" const char *GetCreatureRefId(unsigned short pid) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetCreatureRefId(unsigned short pid) noexcept; /** * \brief Check whether a player's name is replaced by that of the creature they are diff --git a/apps/openmw-mp/Script/Functions/Spells.hpp b/apps/openmw-mp/Script/Functions/Spells.hpp index 69b709406..a0e1160da 100644 --- a/apps/openmw-mp/Script/Functions/Spells.hpp +++ b/apps/openmw-mp/Script/Functions/Spells.hpp @@ -34,7 +34,7 @@ namespace SpellFunctions * \param pid The player ID whose spellbook changes should be used. * \return The number of indexes. */ - extern "C" unsigned int GetSpellbookChangesSize(unsigned short pid) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetSpellbookChangesSize(unsigned short pid) noexcept; /** * \brief Get the action type used in a player's latest spellbook changes. @@ -42,7 +42,7 @@ namespace SpellFunctions * \param pid The player ID whose spellbook changes should be used. * \return The action type (0 for SET, 1 for ADD, 2 for REMOVE). */ - extern "C" unsigned int GetSpellbookChangesAction(unsigned short pid) noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetSpellbookChangesAction(unsigned short pid) noexcept; /** * \brief Set the action type in a player's spellbook changes. @@ -69,7 +69,7 @@ namespace SpellFunctions * \param index The index of the spell. * \return The spellId. */ - extern "C" const char *GetSpellId(unsigned short pid, unsigned int index) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetSpellId(unsigned short pid, unsigned int index) noexcept; /** * \brief Send a PlayerSpellbook packet with a player's recorded spellbook changes. diff --git a/apps/openmw-mp/Script/Functions/Stats.hpp b/apps/openmw-mp/Script/Functions/Stats.hpp index 2bc6962b9..ea963d50b 100644 --- a/apps/openmw-mp/Script/Functions/Stats.hpp +++ b/apps/openmw-mp/Script/Functions/Stats.hpp @@ -123,7 +123,7 @@ namespace StatsFunctions * \param attributeId The ID of the attribute. * \return The name of the attribute. */ - extern "C" const char *GetAttributeName(unsigned short attributeId) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetAttributeName(unsigned short attributeId) noexcept; /** * \brief Get the name of the skill with a certain numerical ID. @@ -133,7 +133,7 @@ namespace StatsFunctions * \param skillId The ID of the skill. * \return The name of the skill. */ - extern "C" const char *GetSkillName(unsigned short skillId) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetSkillName(unsigned short skillId) noexcept; /** * \brief Get the name of a player. @@ -141,7 +141,7 @@ namespace StatsFunctions * \param pid The player ID. * \return The name of the player. */ - extern "C" const char *GetName(unsigned short pid) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetName(unsigned short pid) noexcept; /** * \brief Get the race of a player. @@ -149,7 +149,7 @@ namespace StatsFunctions * \param pid The player ID. * \return The race of the player. */ - extern "C" const char *GetRace(unsigned short pid) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetRace(unsigned short pid) noexcept; /** * \brief Get the head mesh used by a player. @@ -157,7 +157,7 @@ namespace StatsFunctions * \param pid The player ID. * \return The head mesh of the player. */ - extern "C" const char *GetHead(unsigned short pid) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetHead(unsigned short pid) noexcept; /** * \brief Get the hairstyle mesh used by a player. @@ -165,7 +165,7 @@ namespace StatsFunctions * \param pid The player ID. * \return The hairstyle mesh of the player. */ - extern "C" const char *GetHairstyle(unsigned short pid) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetHairstyle(unsigned short pid) noexcept; /** * \brief Check whether a player is male or not. @@ -181,7 +181,7 @@ namespace StatsFunctions * \param pid The player ID. * \return The birthsign of the player. */ - extern "C" const char *GetBirthsign(unsigned short pid) noexcept; + EXPORT_APIFUNCTION const char *CDECL GetBirthsign(unsigned short pid) noexcept; /** * \brief Get the character level of a player. diff --git a/apps/openmw-mp/Script/Functions/Worldstate.hpp b/apps/openmw-mp/Script/Functions/Worldstate.hpp index e2352bd88..5e3b8fa76 100644 --- a/apps/openmw-mp/Script/Functions/Worldstate.hpp +++ b/apps/openmw-mp/Script/Functions/Worldstate.hpp @@ -93,14 +93,14 @@ namespace WorldstateFunctions * * \return The number of indexes. */ - extern "C" unsigned int GetMapChangesSize() noexcept; + EXPORT_APIFUNCTION unsigned int CDECL GetMapChangesSize() noexcept; /** * \brief Get the weather region in the read worldstate. * * \return The weather region. */ - extern "C" const char *GetWeatherRegion() noexcept; + EXPORT_APIFUNCTION const char *CDECL GetWeatherRegion() noexcept; /** * \brief Get the current weather in the read worldstate.