aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--erts/etc/common/run_erl_common.c19
-rw-r--r--erts/etc/unix/run_erl.c4
-rw-r--r--lib/ic/c_src/oe_ei_encode_pid.c2
-rw-r--r--lib/odbc/c_src/odbcserver.c19
-rw-r--r--lib/odbc/c_src/odbcserver.h4
5 files changed, 28 insertions, 20 deletions
diff --git a/erts/etc/common/run_erl_common.c b/erts/etc/common/run_erl_common.c
index dc55c2bea4..580b6cc3c5 100644
--- a/erts/etc/common/run_erl_common.c
+++ b/erts/etc/common/run_erl_common.c
@@ -74,15 +74,6 @@
* run_erl multiple times with different global variables without them
* effecting eachother.
*/
-typedef struct run_erl_ run_erl;
-
-#ifdef __OSE__
-static OSPPDKEY run_erl_pp_key;
-#define RE_DATA (*(run_erl**)ose_get_ppdata(run_erl_pp_key))
-#else
-static run_erl re;
-#define RE_DATA (&re)
-#endif
#define STATUSFILE (RE_DATA->statusfile)
#define LOG_DIR (RE_DATA->log_dir)
@@ -116,6 +107,16 @@ struct run_erl_ {
unsigned protocol_ver;
};
+typedef struct run_erl_ run_erl;
+
+#ifdef __OSE__
+static OSPPDKEY run_erl_pp_key;
+#define RE_DATA (*(run_erl**)ose_get_ppdata(run_erl_pp_key))
+#else
+static run_erl re;
+#define RE_DATA (&re)
+#endif
+
/* prototypes */
static int next_log(int log_num);
diff --git a/erts/etc/unix/run_erl.c b/erts/etc/unix/run_erl.c
index a6fc4c2bf5..4b123b8911 100644
--- a/erts/etc/unix/run_erl.c
+++ b/erts/etc/unix/run_erl.c
@@ -40,9 +40,13 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
+
#ifdef HAVE_WORKING_POSIX_OPENPT
+#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 600
#endif
+#endif
+
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
diff --git a/lib/ic/c_src/oe_ei_encode_pid.c b/lib/ic/c_src/oe_ei_encode_pid.c
index b7083f84a0..609f441cf8 100644
--- a/lib/ic/c_src/oe_ei_encode_pid.c
+++ b/lib/ic/c_src/oe_ei_encode_pid.c
@@ -23,7 +23,7 @@
int oe_ei_encode_pid(CORBA_Environment *ev, const erlang_pid *p) {
int size = ev->_iout;
- (int) ei_encode_pid(NULL, &size, p);
+ ei_encode_pid(NULL, &size, p);
if (size >= ev->_outbufsz) {
char *buf = ev->_outbuf;
diff --git a/lib/odbc/c_src/odbcserver.c b/lib/odbc/c_src/odbcserver.c
index b4655ce373..84c201a656 100644
--- a/lib/odbc/c_src/odbcserver.c
+++ b/lib/odbc/c_src/odbcserver.c
@@ -389,6 +389,9 @@ DWORD WINAPI database_handler(const char *port)
close_socket(socket);
clean_socket_lib();
/* Exit will be done by suervisor thread */
+#ifdef WIN32
+ return (DWORD)0;
+#endif
}
/* Description: Calls the appropriate function to handle the database
@@ -631,7 +634,7 @@ static db_result_msg db_query(byte *sql, db_state *state)
&statement_handle(state))))
DO_EXIT(EXIT_ALLOC);
- result = SQLExecDirect(statement_handle(state), sql, SQL_NTS);
+ result = SQLExecDirect(statement_handle(state), (SQLCHAR *)sql, SQL_NTS);
/* SQL_SUCCESS_WITH_INFO at this point may indicate an error in user input. */
if (result != SQL_SUCCESS && result != SQL_NO_DATA_FOUND) {
@@ -723,7 +726,7 @@ static db_result_msg db_select_count(byte *sql, db_state *state)
(SQLPOINTER)SQL_SCROLLABLE, (SQLINTEGER)0);
}
- if(!sql_success(SQLExecDirect(statement_handle(state), sql, SQL_NTS))) {
+ if(!sql_success(SQLExecDirect(statement_handle(state), (SQLCHAR *)sql, SQL_NTS))) {
diagnos = get_diagnos(SQL_HANDLE_STMT, statement_handle(state), extended_errors(state));
clean_state(state);
return encode_error_message(diagnos.error_msg, extended_error(state, diagnos.sqlState), diagnos.nativeError);
@@ -864,7 +867,7 @@ static db_result_msg db_param_query(byte *buffer, db_state *state)
if(params != NULL) {
- result = SQLExecDirect(statement_handle(state), sql, SQL_NTS);
+ result = SQLExecDirect(statement_handle(state), (SQLCHAR *)sql, SQL_NTS);
if (!sql_success(result) || result == SQL_NO_DATA) {
diagnos = get_diagnos(SQL_HANDLE_STMT, statement_handle(state), extended_errors(state));
}
@@ -955,7 +958,7 @@ static db_result_msg db_describe_table(byte *sql, db_state *state)
&statement_handle(state))))
DO_EXIT(EXIT_ALLOC);
- if (!sql_success(SQLPrepare(statement_handle(state), sql, SQL_NTS))){
+ if (!sql_success(SQLPrepare(statement_handle(state), (SQLCHAR *)sql, SQL_NTS))){
diagnos = get_diagnos(SQL_HANDLE_STMT, statement_handle(state), extended_errors(state));
msg = encode_error_message(diagnos.error_msg, extended_error(state, diagnos.sqlState), diagnos.nativeError);
clean_state(state);
@@ -1324,7 +1327,7 @@ static db_result_msg encode_column_name_list(SQLSMALLINT num_of_columns,
if (columns(state)[i].type.c == SQL_C_BINARY) {
/* retrived later by retrive_binary_data */
- }else {
+ } else {
if(!sql_success(
SQLBindCol
(statement_handle(state),
@@ -1336,7 +1339,7 @@ static db_result_msg encode_column_name_list(SQLSMALLINT num_of_columns,
DO_EXIT(EXIT_BIND);
}
ei_x_encode_string_len(&dynamic_buffer(state),
- name, name_len);
+ (char *)name, name_len);
}
else {
columns(state)[i].type.len = 0;
@@ -2739,8 +2742,8 @@ static diagnos get_diagnos(SQLSMALLINT handleType, SQLHANDLE handle, Boolean ext
the error message is obtained */
for(record_nr = 1; ;record_nr++) {
result = SQLGetDiagRec(handleType, handle, record_nr, current_sql_state,
- &nativeError, current_errmsg_pos,
- (SQLSMALLINT)errmsg_buffer_size, &errmsg_size);
+ &nativeError, (SQLCHAR *)current_errmsg_pos,
+ (SQLSMALLINT)errmsg_buffer_size, &errmsg_size);
if(result == SQL_SUCCESS) {
/* update the sqlstate in the diagnos record, because the SQLGetDiagRec
call succeeded */
diff --git a/lib/odbc/c_src/odbcserver.h b/lib/odbc/c_src/odbcserver.h
index 916a7cb31d..7112fd2d47 100644
--- a/lib/odbc/c_src/odbcserver.h
+++ b/lib/odbc/c_src/odbcserver.h
@@ -119,7 +119,7 @@
/*------------------------ TYPDEFS ----------------------------------*/
-typedef unsigned char byte;
+typedef char byte;
typedef int Boolean;
typedef struct {
@@ -201,4 +201,4 @@ typedef enum {
#define param_query(db_state) (db_state -> param_query)
#define out_params(db_state) (db_state -> out_params)
#define extended_errors(db_state) (db_state -> extended_errors)
-#define extended_error(db_state, errorcode) ( extended_errors(state) ? errorcode : NULL )
+#define extended_error(db_state, errorcode) ( extended_errors(state) ? ((char *)errorcode) : NULL )