octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: safer way to use gnulib ('C++' + 'gnulib' does not still work on Min


From: Tatsuro MATSUOKA
Subject: Re: safer way to use gnulib ('C++' + 'gnulib' does not still work on MinGW )
Date: Wed, 24 Mar 2010 10:49:05 +0900 (JST)

Hello


The origin compile error on quit.cc in libcruft seemed to he  

#if (defined __need_time_t || defined __need_clock_t \
     || defined __need_timespec \
     || defined _GL_TIME_H)
is not true in MinGW system.
As a trial, I added -D_GL_TIME_H in complier flag, the compile of  quit.cc was 
successful.

Perhaps for other gnulib modules, similar behavior might happen

MinGW has sys/time.h and time.h but perhaps they are incomplete for the octave 
so that octave decide
to use gnulib sys/time.h and time.h.

If possible, please give me suggestions.

Regards

Tatsuro

--- Tatsuro MATSUOKA wrote:

> Hello
> 
> The previous mail
> 
> http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2010-March/015556.html
> --- Tatsuro MATSUOKA  wrote:
> 
> ::::::::::::::::::::::
> > # if 1
> > #  if 1
> > //#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
> > #    define nanosleep rpl_nanosleep
> > //#   endif
> > 
> > If the comment out like above are carried out  for the declaration error 
> > from the same origin,
> > compile
> > goes well.
> :::::::::::::::::::::::
> 
> 
> Perhaps the above situation comes from some miss setting of gnulib on octave.
> 
> I have personally made libgnu library for time and nanosleep modules from 
> gnulib directory of
> octave.
> 
> cd /cygdrive/c/usr/tatsu/test/testgnu
> /cygdrive/c/usr/tatsu/mingwhome/octaves/hg/octave-work/gnulib/gnulib-tool 
> --create-testdir
> --dir=/cygdrive/c/usr/tatsu/test/testgnu/time time nanosleep 
> cd time
> ./configure
> make
> cd ..
> rm *.o
> g++ -c testcc.cc -I./time/gllib
> 
> // testcc.cc
> #include <iostream>
> int main(void)
> {
>       nanosleep();
>       return 0;
> }
> //
> 
> Obviously  the above incorrect code, the error massages are 
> 
> $ g++ -c testcc.cc -I./time/gllib
> In file included from ./time/gllib/wchar.h:64:0,
>                  from 
> c:\programs\mingw\bin\../lib/gcc/mingw32/4.5.0/include/c++/cwchar:47,
>                  from
> c:\programs\mingw\bin\../lib/gcc/mingw32/4.5.0/include/c++/bits/postypes.h:42,
>                  from 
> c:\programs\mingw\bin\../lib/gcc/mingw32/4.5.0/include/c++/iosfwd:42,
>                  from 
> c:\programs\mingw\bin\../lib/gcc/mingw32/4.5.0/include/c++/ios:39,
>                  from 
> c:\programs\mingw\bin\../lib/gcc/mingw32/4.5.0/include/c++/ostream:40,
>                  from 
> c:\programs\mingw\bin\../lib/gcc/mingw32/4.5.0/include/c++/iostream:40,
>                  from testcc.cc:1:
> ./time/gllib/time.h:374:1: error: expected ',' or '...' before '__timer'
> ./time/gllib/time.h:374:1: error: nonnull argument with out-of-range operand 
> number (argument 1,
> operand 2)
> ./time/gllib/time.h:389:1: error: expected ',' or '...' before '__timer'
> ./time/gllib/time.h:389:1: error: nonnull argument with out-of-range operand 
> number (argument 1,
> operand 2)
> ./time/gllib/time.h:410:1: error: expected ',' or '...' before '__buf'
> ./time/gllib/time.h:410:1: error: nonnull argument with out-of-range operand 
> number (argument 1,
> operand 2)
> testcc.cc: In function 'int main()':
> testcc.cc:4:12: error: too few arguments to function 'int rpl_nanosleep(const 
> rpl_timespec*,
> rpl_timespec*)'
> ./time/gllib/time.h:339:1: note: declared here
> 
> #*****************
> The point I would like to say that
> too few arguments to function 'int rpl_nanosleep(const rpl_timespec*, 
> rpl_timespec*)'
> 
> symbol rpl_nanosleep recognized correctly. 
> 
> In time.h
> 
> There found
> #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
>   _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
> #if defined __cplusplus && defined GNULIB_NAMESPACE
> # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
>     namespace GNULIB_NAMESPACE                                \
>     {                                                         \
>       rettype (*const func) parameters = ::rpl_func;          \
>     }                                                         \
>     _GL_EXTERN_C int _gl_cxxalias_dummy
> #else
> # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
>     _GL_EXTERN_C int _gl_cxxalias_dummy
> #endif
> 
> If the above is correctly , rpl_'ed functions can be called from C++ program.
> However, the current situation in building octave on the MinGW are different 
> from the simple
> test.
> 
> This is all that I can say at present.
> 
> Regards
> 
> Tatsuro 
> 
> 
> --------------------------------------
> VANCOUVER 2010 PARALYMPIC GAMES News
> http://pr.mail.yahoo.co.jp/para/
> 


--------------------------------------
Get the new Internet Explorer 8 optimized for Yahoo! JAPAN
http://pr.mail.yahoo.co.jp/ie8/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]