LightWrap++
AC++wrapperfortheLightWave3DSDK
platform_win.h
Go to the documentation of this file.
1 
5 #ifndef LWPP_PLATFORM_WIN_H
6 #define LWPP_PLATFORM_WIN_H
7 
8 #pragma warning (push,1)
9 #ifdef _DEBUG
10  #define _CRTDBG_MAP_ALLOC
11  #include <stdlib.h>
12  #include <crtdbg.h>
13  #define DEBUG_NEW new(_CLIENT_BLOCK, __FILE__, __LINE__)
14 /*
15  #ifndef _CRTDBG_MAP_ALLOC
16  #define _CRTDBG_MAP_ALLOC
17  #endif
18 */
19 #else
20  #include <stdlib.h>
21  #define DEBUG_CLIENTBLOCK
22 #endif
23 //#define WIN32_LEAN_AND_MEAN
24 #include <windows.h>
25 #include <shlobj.h>
26 #include <direct.h>
27 #include <cmath>
28 #include <cstring>
29 #include <sstream>
30 #include <string>
31 #include <ios>
32 #include <cstdlib>
33 #include <sys/types.h>
34 #include <sys/stat.h>
35 #include <malloc.h> // _alloca
36 #pragma warning (pop)
37 #pragma warning(disable : 4996)
38 #pragma warning(disable : 4530)
39 #pragma warning(disable : 4291) // warning no matching delete operator found
40 
41 #ifdef _DEBUG
42  #define new DEBUG_NEW
43 #endif
44 
45 /******************************************************************************
46 * MODULE : dirent.h
47 * DESCRIPTION: Windows version of POSIX dirent.h
48 * COPYRIGHT : (C) 2003 Dan Martens dan_martens@lycos.com
49 *******************************************************************************
50 * This software falls under the GNU general public license and comes WITHOUT
51 * ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details.
52 * If you don't have this file, write to the Free Software Foundation, Inc.,
53 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
54 ******************************************************************************/
55 struct dirent
56 {
57  long d_ino; /* unique file number */
58  off_t d_off; /*offset of this file within the director*/
59  unsigned short d_reclen; /*length of this entry*/
60  char d_name[MAX_PATH]; /*name of the entry*/
61 };
62 
63 typedef struct DIR_
64 {
65  bool isOpen;
67  HANDLE findHandle;
68  int position;
69  WIN32_FIND_DATA findData;
70  char d_name[MAX_PATH];
71 }DIR;
72 
73 int closedir(DIR *);
74 DIR *opendir(const char *);
75 struct dirent *readdir(DIR *);
76 int readdir_r(DIR *, struct dirent *, struct dirent **);
77 void rewinddir(DIR *);
78 void seekdir(DIR *, long int);
79 long int telldir(DIR *);
80 
81 extern const char *strptime(const char *p, const char *fmt, struct tm *dt);
82 
83 // define the files to link to automatically for plugins
84 #ifdef _WIN64
85  #ifdef _DEBUG
86  #pragma comment(lib, "lwpp64d.lib")
87  #else
88  #pragma comment(lib, "lwpp64.lib")
89  #endif
90 #else
91  #ifdef _DEBUG
92  #pragma comment(lib, "lwppd.lib")
93  #else
94  #pragma comment(lib, "lwpp.lib")
95  #endif
96 #endif
97 
98 #endif // LWPP_PLATFORM_WIN_H