mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
merge revision(s) a0bc3f2a1c2c98f225612101cb4e1ea1a6813546,75a0447c15a7ab017bd4240c2a9cc69b134b80b9,f1699314147bad2cf5550cc582693424fdbc2510: [Backport #16846]
Suppress C4267 "possible loss of data" warnings --- ext/win32ole/win32ole.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Suppress C4267 "possible loss of data" warnings Just cast down explicitly. --- ext/win32ole/win32ole.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) win32ole: separate global variable declarations and definitions https://gcc.gnu.org/gcc-10/changes.html#c > * GCC now defaults to `-fno-common`. As a result, global > variable accesses are more efficient on various targets. In > C, global variables with multiple tentative definitions now > result in linker errors. With `-fcommon` such definitions are > silently merged during linking. --- ext/win32ole/win32ole.c | 1 + ext/win32ole/win32ole.h | 4 ++-- ext/win32ole/win32ole_error.c | 3 +++ ext/win32ole/win32ole_error.h | 4 ++-- ext/win32ole/win32ole_method.c | 2 ++ ext/win32ole/win32ole_method.h | 2 +- ext/win32ole/win32ole_record.c | 2 ++ ext/win32ole/win32ole_record.h | 2 +- ext/win32ole/win32ole_type.c | 2 ++ ext/win32ole/win32ole_type.h | 2 +- ext/win32ole/win32ole_typelib.c | 2 ++ ext/win32ole/win32ole_typelib.h | 2 +- ext/win32ole/win32ole_variable.c | 2 ++ ext/win32ole/win32ole_variable.h | 2 +- ext/win32ole/win32ole_variant.c | 2 ++ ext/win32ole/win32ole_variant.h | 2 +- ext/win32ole/win32ole_variant_m.c | 2 ++ ext/win32ole/win32ole_variant_m.h | 2 +- 18 files changed, 29 insertions(+), 11 deletions(-) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ae1573ac73
commit
1bce19a7e5
19 changed files with 31 additions and 13 deletions
|
@ -2663,7 +2663,7 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
|
|||
/*------------------------------------------
|
||||
hash object ==> named dispatch parameters
|
||||
--------------------------------------------*/
|
||||
cNamedArgs = rb_long2int(RHASH_SIZE(param));
|
||||
cNamedArgs = rb_long2int((long)RHASH_SIZE(param));
|
||||
op.dp.cArgs = cNamedArgs + argc - 2;
|
||||
op.pNamedArgs = ALLOCA_N(OLECHAR*, cNamedArgs + 1);
|
||||
op.dp.rgvarg = ALLOCA_N(VARIANTARG, op.dp.cArgs);
|
||||
|
@ -3974,6 +3974,7 @@ check_nano_server(void)
|
|||
}
|
||||
}
|
||||
|
||||
LCID cWIN32OLE_lcid;
|
||||
|
||||
void
|
||||
Init_win32ole(void)
|
||||
|
|
|
@ -112,8 +112,8 @@ struct oledata {
|
|||
IDispatch *pDispatch;
|
||||
};
|
||||
|
||||
VALUE cWIN32OLE;
|
||||
LCID cWIN32OLE_lcid;
|
||||
extern VALUE cWIN32OLE;
|
||||
extern LCID cWIN32OLE_lcid;
|
||||
|
||||
struct oledata *oledata_get_struct(VALUE obj);
|
||||
LPWSTR ole_vstr2wc(VALUE vstr);
|
||||
|
|
|
@ -60,6 +60,9 @@ ole_raise(HRESULT hr, VALUE ecs, const char *fmt, ...)
|
|||
rb_exc_raise(rb_exc_new_str(ecs, msg));
|
||||
}
|
||||
|
||||
VALUE eWIN32OLERuntimeError;
|
||||
VALUE eWIN32OLEQueryInterfaceError;
|
||||
|
||||
void
|
||||
Init_win32ole_error(void)
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef WIN32OLE_ERROR_H
|
||||
#define WIN32OLE_ERROR_H 1
|
||||
|
||||
VALUE eWIN32OLERuntimeError;
|
||||
VALUE eWIN32OLEQueryInterfaceError;
|
||||
extern VALUE eWIN32OLERuntimeError;
|
||||
extern VALUE eWIN32OLEQueryInterfaceError;
|
||||
NORETURN(PRINTF_ARGS(void ole_raise(HRESULT hr, VALUE ecs, const char *fmt, ...), 3, 4));
|
||||
void Init_win32ole_error(void);
|
||||
|
||||
|
|
|
@ -923,6 +923,8 @@ folemethod_inspect(VALUE self)
|
|||
return default_inspect(self, "WIN32OLE_METHOD");
|
||||
}
|
||||
|
||||
VALUE cWIN32OLE_METHOD;
|
||||
|
||||
void Init_win32ole_method(void)
|
||||
{
|
||||
cWIN32OLE_METHOD = rb_define_class("WIN32OLE_METHOD", rb_cObject);
|
||||
|
|
|
@ -7,7 +7,7 @@ struct olemethoddata {
|
|||
UINT index;
|
||||
};
|
||||
|
||||
VALUE cWIN32OLE_METHOD;
|
||||
extern VALUE cWIN32OLE_METHOD;
|
||||
VALUE folemethod_s_allocate(VALUE klass);
|
||||
VALUE ole_methods_from_typeinfo(ITypeInfo *pTypeInfo, int mask);
|
||||
VALUE create_win32ole_method(ITypeInfo *pTypeInfo, VALUE name);
|
||||
|
|
|
@ -589,6 +589,8 @@ folerecord_inspect(VALUE self)
|
|||
field);
|
||||
}
|
||||
|
||||
VALUE cWIN32OLE_RECORD;
|
||||
|
||||
void
|
||||
Init_win32ole_record(void)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef WIN32OLE_RECORD_H
|
||||
#define WIN32OLE_RECORD_H 1
|
||||
|
||||
VALUE cWIN32OLE_RECORD;
|
||||
extern VALUE cWIN32OLE_RECORD;
|
||||
void ole_rec2variant(VALUE rec, VARIANT *var);
|
||||
void olerecord_set_ivar(VALUE obj, IRecordInfo *pri, void *prec);
|
||||
VALUE create_win32ole_record(IRecordInfo *pri, void *prec);
|
||||
|
|
|
@ -883,6 +883,8 @@ foletype_inspect(VALUE self)
|
|||
return default_inspect(self, "WIN32OLE_TYPE");
|
||||
}
|
||||
|
||||
VALUE cWIN32OLE_TYPE;
|
||||
|
||||
void Init_win32ole_type(void)
|
||||
{
|
||||
cWIN32OLE_TYPE = rb_define_class("WIN32OLE_TYPE", rb_cObject);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef WIN32OLE_TYPE_H
|
||||
#define WIN32OLE_TYPE_H 1
|
||||
VALUE cWIN32OLE_TYPE;
|
||||
extern VALUE cWIN32OLE_TYPE;
|
||||
VALUE create_win32ole_type(ITypeInfo *pTypeInfo, VALUE name);
|
||||
ITypeInfo *itypeinfo(VALUE self);
|
||||
VALUE ole_type_from_itypeinfo(ITypeInfo *pTypeInfo);
|
||||
|
|
|
@ -822,6 +822,8 @@ foletypelib_inspect(VALUE self)
|
|||
return default_inspect(self, "WIN32OLE_TYPELIB");
|
||||
}
|
||||
|
||||
VALUE cWIN32OLE_TYPELIB;
|
||||
|
||||
void
|
||||
Init_win32ole_typelib(void)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef WIN32OLE_TYPELIB_H
|
||||
#define WIN32OLE_TYPELIB_H 1
|
||||
|
||||
VALUE cWIN32OLE_TYPELIB;
|
||||
extern VALUE cWIN32OLE_TYPELIB;
|
||||
|
||||
void Init_win32ole_typelib(void);
|
||||
ITypeLib * itypelib(VALUE self);
|
||||
|
|
|
@ -365,6 +365,8 @@ folevariable_inspect(VALUE self)
|
|||
return make_inspect("WIN32OLE_VARIABLE", detail);
|
||||
}
|
||||
|
||||
VALUE cWIN32OLE_VARIABLE;
|
||||
|
||||
void Init_win32ole_variable(void)
|
||||
{
|
||||
cWIN32OLE_VARIABLE = rb_define_class("WIN32OLE_VARIABLE", rb_cObject);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef WIN32OLE_VARIABLE_H
|
||||
#define WIN32OLE_VARIABLE_H 1
|
||||
|
||||
VALUE cWIN32OLE_VARIABLE;
|
||||
extern VALUE cWIN32OLE_VARIABLE;
|
||||
VALUE create_win32ole_variable(ITypeInfo *pTypeInfo, UINT index, VALUE name);
|
||||
void Init_win32ole_variable(void);
|
||||
|
||||
|
|
|
@ -689,6 +689,8 @@ ole_variant2variant(VALUE val, VARIANT *var)
|
|||
VariantCopy(var, &(pvar->var));
|
||||
}
|
||||
|
||||
VALUE cWIN32OLE_VARIANT;
|
||||
|
||||
void
|
||||
Init_win32ole_variant(void)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef WIN32OLE_VARIANT_H
|
||||
#define WIN32OLE_VARIANT_H 1
|
||||
|
||||
VALUE cWIN32OLE_VARIANT;
|
||||
extern VALUE cWIN32OLE_VARIANT;
|
||||
void ole_variant2variant(VALUE val, VARIANT *var);
|
||||
void Init_win32ole_variant(void);
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "win32ole.h"
|
||||
|
||||
VALUE mWIN32OLE_VARIANT;
|
||||
|
||||
void Init_win32ole_variant_m(void)
|
||||
{
|
||||
/*
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef WIN32OLE_VARIANT_M_H
|
||||
#define WIN32OLE_VARIANT_M_H 1
|
||||
|
||||
VALUE mWIN32OLE_VARIANT;
|
||||
extern VALUE mWIN32OLE_VARIANT;
|
||||
void Init_win32ole_variant_m(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#define RUBY_VERSION "2.6.7"
|
||||
#define RUBY_RELEASE_DATE "2021-04-05"
|
||||
#define RUBY_PATCHLEVEL 178
|
||||
#define RUBY_PATCHLEVEL 179
|
||||
|
||||
#define RUBY_RELEASE_YEAR 2021
|
||||
#define RUBY_RELEASE_MONTH 4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue