[#23231] What do you think about changing the return value of Kernel#require and Kernel#load to the source encoding of the required file? — =?ISO-8859-15?Q?Wolfgang_N=E1dasi-Donner?= <ed.odanow@...>

Dear Ruby developers and users!

8 messages 2009/04/17

[#23318] [Feature #1408] 0.1.to_r not equal to (1/10) — Heesob Park <redmine@...>

Feature #1408: 0.1.to_r not equal to (1/10)

19 messages 2009/04/26

[ruby-core:23096] [Bug #1346] Linkage errors compiling C++ extension with VC8

From: Miguel Muñoz <redmine@...>
Date: 2009-04-01 15:05:08 UTC
List: ruby-core #23096
Bug #1346: Linkage errors compiling C++ extension with VC8
http://redmine.ruby-lang.org/issues/show/1346

Author: Miguel Mu単oz
Status: Open, Priority: Normal
Target version: 1.9.1
ruby -v: ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-mswin32_80]

I've found two problems with extern "C" blocks while compiling some code generated by SWIG (the class example in the SWIG 1.3.39 distribution). I'm not sure if the problems came from Ruby or from SWIG, but I'd be grateful if someone can take a look at it.

The first error was:
...\microsoft visual studio 8\vc\platformsdk\include\wspiapi.h(44) : error C2894: templates cannot be declared to have 'C' linkage

I found a provisional workaround by modifying ruby-1.9.1-p0\include\ruby-1.9.1\ruby\win32.h, adding extern "C++" around some imports:

#if !defined(WSAAPI)
#ifdef __cplusplus
extern "C++"
{
#include <winsock2.h>
#include <ws2tcpip.h>
}
#else
#include <winsock2.h>
#include <ws2tcpip.h>
#endif
#endif


The second error came from a Ruby file:
...\ruby-1.9.1-p0\include\ruby-1.9.1\ruby\missing.h(157) : error C2375: 'vsnprintf' : redefinition; different linkage
(...\microsoft visual studio 8\vc\include\stdio.h(333) : see declaration of 'vsnprintf')

For this one I just commented the vnsprintf function definition in missing.h:

//RUBY_EXTERN int vsnprintf(char *, size_t n, char const *, va_list);


Kind regards,

Miguel


----------------------------------------
http://redmine.ruby-lang.org

In This Thread

Prev Next