[PATCH 37/50] [testtools] Calling Convention for Windows Callbacks


Michael Schonberg <mschonberg@...>
 

From: Mike Schonberg <mschonberg@nyx.com>

Use MAMACALLTYPE for callbacks in mamachurn and mamaconsumer in the test tools
directory.

Signed-off-by: Mike Schonberg <mschonberg@nyx.com>
---
mama/c_cpp/src/testtools/load/c/mamachurnc.c | 16 ++++++++--------
.../src/testtools/performance/c/mamaconsumerc.c | 19 ++++++++-----------
2 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/mama/c_cpp/src/testtools/load/c/mamachurnc.c b/mama/c_cpp/src/testtools/load/c/mamachurnc.c
index 37a89dd..0f3d037 100644
--- a/mama/c_cpp/src/testtools/load/c/mamachurnc.c
+++ b/mama/c_cpp/src/testtools/load/c/mamachurnc.c
@@ -110,7 +110,7 @@ static void ClearCounters(void)

#define STATS_FIELD_WIDTH -5 /* negative = left alignment */

-static void statsCallback(mamaTimer timer, void *closure)
+static void MAMACALLTYPE statsCallback(mamaTimer timer, void *closure)
{
time_t t;
struct tm tmResult;
@@ -166,7 +166,7 @@ static void checkStatus(char *err, mama_status status)
}
}

-static void subscriptionOnCreate(mamaSubscription subscription, void* closure)
+static void MAMACALLTYPE subscriptionOnCreate(mamaSubscription subscription, void* closure)
{
const char* symbol = NULL;

@@ -178,7 +178,7 @@ static void subscriptionOnCreate(mamaSubscription subscription, void* closure)
}
}

-static void subscriptionOnError(mamaSubscription subscription,
+static void MAMACALLTYPE subscriptionOnError(mamaSubscription subscription,
mama_status status,
void* platformError,
const char* subject,
@@ -193,7 +193,7 @@ static void subscriptionOnError(mamaSubscription subscription,
mamaSubscription_activate(subscription);
}

-static void subscriptionOnMsg(mamaSubscription subscription,
+static void MAMACALLTYPE subscriptionOnMsg(mamaSubscription subscription,
mamaMsg msg,
void *closure,
void *itemClosure)
@@ -286,13 +286,13 @@ static void createSubscription(int index)
checkStatus("mamaSubscription_create()",status);
}

-static void lifetimeCallback(mamaTimer timer, void *closure)
+static void MAMACALLTYPE lifetimeCallback(mamaTimer timer, void *closure)
{
mama_stop(gBridge);
printf("Lifetime expired\n");
}

-static void recreateCallback(mamaTimer timer, void *closure)
+static void MAMACALLTYPE recreateCallback(mamaTimer timer, void *closure)
{
/* try to destroy existing subscription */
destroySubscription((int)closure);
@@ -300,7 +300,7 @@ static void recreateCallback(mamaTimer timer, void *closure)
mamaTimer_destroy(timer);
}

-static void churnCallback(mamaTimer timer, void *closure)
+static void MAMACALLTYPE churnCallback(mamaTimer timer, void *closure)
{
int churnCount = 0;
int churnIndex = 0;
@@ -324,7 +324,7 @@ static void churnCallback(mamaTimer timer, void *closure)
gChurned+=churnCount;
}

-static void transportCb(mamaTransport tport,mamaTransportEvent ev,
+static void MAMACALLTYPE transportCb(mamaTransport tport,mamaTransportEvent ev,
short cause,const void *opaque,void *closure)
{
mamaQuality quality = MAMA_QUALITY_UNKNOWN;
diff --git a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c
index 106a0ef..2df8881 100644
--- a/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c
+++ b/mama/c_cpp/src/testtools/performance/c/mamaconsumerc.c
@@ -24,9 +24,6 @@
#include "string.h"
#include <stdlib.h>

-#include "pthread.h"
-#include <unistd.h>
-
/* MAMA function checking macro */
#define MAMA_CHECK(status) \
{ \
@@ -107,13 +104,13 @@ static void mc_createSubscriber
mamaQueue queue
);

-static void mc_createCb
+static void MAMACALLTYPE mc_createCb
(
mamaSubscription subscription,
void * closure
);

-static void mc_errorCb
+static void MAMACALLTYPE mc_errorCb
(
mamaSubscription subscription,
mama_status status,
@@ -122,7 +119,7 @@ static void mc_errorCb
void* closure
);

-static void mc_msgCb
+static void MAMACALLTYPE mc_msgCb
(
mamaSubscription subscription,
mamaMsg msg,
@@ -130,7 +127,7 @@ static void mc_msgCb
void * itemClosure
);

-static void mc_msgCb2
+static void MAMACALLTYPE mc_msgCb2
(
mamaSubscription subscription,
mamaMsg msg,
@@ -296,7 +293,7 @@ static void mc_createSubscriber
/**********************************************************
* mc_createCb *
**********************************************************/
-static void mc_createCb
+static void MAMACALLTYPE mc_createCb
(
mamaSubscription subscription,
void * closure
@@ -308,7 +305,7 @@ static void mc_createCb
/**********************************************************
* mc_errorCb *
**********************************************************/
-static void mc_errorCb
+static void MAMACALLTYPE mc_errorCb
(
mamaSubscription subscription,
mama_status status,
@@ -327,7 +324,7 @@ static void mc_errorCb
/**********************************************************
* mc_msgCb *
**********************************************************/
-static void mc_msgCb
+static void MAMACALLTYPE mc_msgCb
(
mamaSubscription subscription,
mamaMsg msg,
@@ -400,7 +397,7 @@ static void mc_msgCb
/**********************************************************
* mc_msgCb2 *
**********************************************************/
-static void mc_msgCb2
+static void MAMACALLTYPE mc_msgCb2
(
mamaSubscription subscription,
mamaMsg msg,
--
1.7.7.6

Join Openmama-dev@lists.openmama.org to automatically receive all group messages.