adhere to windows calling convention

This commit is contained in:
Doug MacEachern 2007-08-22 03:40:57 +00:00
parent 31b7c00012
commit efe0e027c0
1 changed files with 20 additions and 13 deletions

View File

@ -41,7 +41,14 @@
typedef struct ptql_parse_branch_t ptql_parse_branch_t; typedef struct ptql_parse_branch_t ptql_parse_branch_t;
typedef struct ptql_branch_t ptql_branch_t; typedef struct ptql_branch_t ptql_branch_t;
typedef int (*ptql_get_t)(sigar_t *sigar, sigar_pid_t pid, void *data); /* adhere to calling convention, else risk stack corruption */
#ifdef WIN32
#define SIGAPI WINAPI
#else
#define SIGAPI
#endif
typedef int (SIGAPI *ptql_get_t)(sigar_t *sigar, sigar_pid_t pid, void *data);
typedef int (*ptql_branch_init_t)(ptql_parse_branch_t *parsed, ptql_branch_t *branch); typedef int (*ptql_branch_init_t)(ptql_parse_branch_t *parsed, ptql_branch_t *branch);
typedef int (*ptql_op_ui64_t)(ptql_branch_t *branch, typedef int (*ptql_op_ui64_t)(ptql_branch_t *branch,
@ -710,7 +717,7 @@ static int ptql_pid_get(sigar_t *sigar,
return SIGAR_OK; return SIGAR_OK;
} }
static int ptql_pid_match(sigar_t *sigar, static int SIGAPI ptql_pid_match(sigar_t *sigar,
sigar_pid_t pid, sigar_pid_t pid,
void *data) void *data)
{ {
@ -750,7 +757,7 @@ static int ptql_args_branch_init(ptql_parse_branch_t *parsed,
return SIGAR_OK; return SIGAR_OK;
} }
static int ptql_args_match(sigar_t *sigar, static int SIGAPI ptql_args_match(sigar_t *sigar,
sigar_pid_t pid, sigar_pid_t pid,
void *data) void *data)
{ {
@ -818,7 +825,7 @@ static int sigar_proc_env_get_key(void *data,
return SIGAR_OK; return SIGAR_OK;
} }
static int ptql_env_match(sigar_t *sigar, static int SIGAPI ptql_env_match(sigar_t *sigar,
sigar_pid_t pid, sigar_pid_t pid,
void *data) void *data)
{ {
@ -876,7 +883,7 @@ static int ptql_branch_init_port(ptql_parse_branch_t *parsed,
return SIGAR_OK; return SIGAR_OK;
} }
static int ptql_port_match(sigar_t *sigar, static int SIGAPI ptql_port_match(sigar_t *sigar,
sigar_pid_t pid, sigar_pid_t pid,
void *data) void *data)
{ {