octave-maintainers
[Top][All Lists]
Advanced

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

MSVC compiler support [patch 7]: mkdir number of arguments


From: John W. Eaton
Subject: MSVC compiler support [patch 7]: mkdir number of arguments
Date: Tue, 17 Oct 2006 23:23:22 -0400

On 17-Oct-2006, Michael Goffioul wrote:

| Force number of argument to mkdir OK under MSVC (the current test fails).
| 
| Index: configure.in
| ===================================================================
| RCS file: /cvs/octave/configure.in,v
| retrieving revision 1.526
| diff -p -c -r1.526 configure.in
| *** configure.in      13 Oct 2006 18:11:26 -0000      1.526
| --- configure.in      17 Oct 2006 11:07:41 -0000
| *************** AC_FUNC_CLOSEDIR_VOID
| *** 1471,1477 ****
|   AC_CHECK_MEMBERS(struct group.gr_passwd)
|   
|   # mkdir takes a single argument on some systems.
| ! OCTAVE_MKDIR_TAKES_ONE_ARG
|   
|   octave_found_termlib=no
|   for termlib in ncurses curses termcap terminfo termlib; do
| --- 1566,1580 ----
|   AC_CHECK_MEMBERS(struct group.gr_passwd)
|   
|   # mkdir takes a single argument on some systems.
| ! case "$canonical_host_type" in
| !   *-*-msdos)
| !     # The test does not produce a compiler error with MSVC !!!
| !     AC_DEFINE(MKDIR_TAKES_ONE_ARG, 1, [Define if host mkdir takes a single 
argument.])
| !   ;;
| !   *)
| !     OCTAVE_MKDIR_TAKES_ONE_ARG
| !   ;;
| ! esac
|   
|   octave_found_termlib=no
|   for termlib in ncurses curses termcap terminfo termlib; do

I would prefer to fix the test to make it work, so I'm not applying
this patch.

How does the current test fail?  I think the only place that this
macro is used is liboctave/file-ops.cc.  Does that file fail to
compile if MKDIR_TAKES_ONE_ARG is not defined?  If so, what is the
error?

The current test is

  dnl
  dnl Determine if mkdir accepts only one argument instead dnl of the usual 2.
  dnl
  AC_DEFUN(OCTAVE_MKDIR_TAKES_ONE_ARG,
  [AC_CACHE_CHECK([if mkdir takes one argument], octave_cv_mkdir_takes_one_arg,
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
  #ifdef HAVE_SYS_STAT_H
  # include <sys/stat.h>
  #endif
  #ifdef HAVE_UNISTD_H
  # include <unistd.h>
  #endif
  #ifdef HAVE_DIRECT_H
  # include <direct.h>
  #endif]], [[mkdir ("foo", 0);]])],
          octave_cv_mkdir_takes_one_arg=no, octave_cv_mkdir_takes_one_arg=yes)])
  if test $octave_cv_mkdir_takes_one_arg = yes ; then
    AC_DEFINE(MKDIR_TAKES_ONE_ARG, 1, [Define if host mkdir takes a single 
argument.])
  fi
  ])

Does liboctave/file-ops.cc compile correctly if MKDIR_TAKES_ONE_ARG is
NOT defined and direct.h is included?

jwe


reply via email to

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