[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
MSVC compilation patch: opendir, readdir... declaration
From: |
Michael Goffioul |
Subject: |
MSVC compilation patch: opendir, readdir... declaration |
Date: |
Sat, 28 Oct 2006 11:40:35 +0200 |
User-agent: |
Thunderbird 1.5.0.7 (Windows/20060909) |
This patch declares the opendir, readdir... functions. These
declarations are needed
for C++.
Michael.
Index: liboctave/lo-sysdep.cc
===================================================================
RCS file: /cvs/octave/liboctave/lo-sysdep.cc,v
retrieving revision 1.9
diff -c -r1.9 lo-sysdep.cc
*** liboctave/lo-sysdep.cc 26 Oct 2006 00:32:53 -0000 1.9
--- liboctave/lo-sysdep.cc 28 Oct 2006 09:14:50 -0000
***************
*** 38,43 ****
--- 38,44 ----
#include "file-ops.h"
#include "lo-error.h"
#include "pathlen.h"
+ #include "lo-sysdep.h"
std::string
octave_getcwd (void)
***************
*** 101,119 ****
#include <windows.h>
! struct direct
! {
! char *d_name;
! };
!
! typedef struct
{
HANDLE hnd;
WIN32_FIND_DATA fd;
int dirty;
struct direct d;
const char* current;
! } DIR;
DIR *
opendir (const char *name)
--- 102,115 ----
#include <windows.h>
! struct __DIR
{
HANDLE hnd;
WIN32_FIND_DATA fd;
int dirty;
struct direct d;
const char* current;
! };
DIR *
opendir (const char *name)
Index: liboctave/lo-sysdep.h
===================================================================
RCS file: /cvs/octave/liboctave/lo-sysdep.h,v
retrieving revision 1.4
diff -c -r1.4 lo-sysdep.h
*** liboctave/lo-sysdep.h 26 Apr 2005 19:24:29 -0000 1.4
--- liboctave/lo-sysdep.h 28 Oct 2006 09:14:50 -0000
***************
*** 36,41 ****
--- 36,56 ----
extern int gethostname (char *, int);
#endif
+ #ifdef _MSC_VER
+
+ struct direct
+ {
+ char *d_name;
+ };
+ typedef struct __DIR DIR;
+
+ DIR* opendir (const char *name);
+ void rewinddir (DIR* d);
+ void closedir (DIR* d);
+ struct direct *readdir (DIR* d);
+
+ #endif
+
#endif
/*
- MSVC compilation patch: opendir, readdir... declaration,
Michael Goffioul <=