2011-02-18 13:58:08 +00:00
|
|
|
/*
|
2002-10-12 11:37:38 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2008-04-16 22:40:48 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
2018-06-17 16:32:54 +02:00
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __BLI_WINSTUFF_H__
|
|
|
|
#define __BLI_WINSTUFF_H__
|
2009-09-24 19:50:15 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup bli
|
|
|
|
* \brief Compatibility-like things for windows.
|
2011-02-18 13:58:08 +00:00
|
|
|
*/
|
|
|
|
|
2012-04-15 07:54:07 +00:00
|
|
|
#ifndef _WIN32
|
|
|
|
# error "This include is for Windows only!"
|
|
|
|
#endif
|
2010-01-26 11:25:39 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
#define WIN32_LEAN_AND_MEAN
|
2005-03-19 20:04:25 +00:00
|
|
|
|
2020-03-18 10:38:37 -06:00
|
|
|
#include <windows.h>
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
#undef rad
|
|
|
|
#undef rad1
|
|
|
|
#undef rad2
|
|
|
|
#undef rad3
|
|
|
|
#undef vec
|
|
|
|
#undef rect
|
|
|
|
#undef rct1
|
|
|
|
#undef rct2
|
|
|
|
|
|
|
|
#undef small
|
|
|
|
|
2011-03-02 05:05:12 +00:00
|
|
|
// These definitions are also in BLI_math for simplicity
|
2005-03-19 20:04:25 +00:00
|
|
|
|
2008-08-22 15:00:30 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2020-03-18 11:23:56 -06:00
|
|
|
#if !defined(_USE_MATH_DEFINES)
|
|
|
|
# define _USE_MATH_DEFINES
|
|
|
|
#endif
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
#define MAXPATHLEN MAX_PATH
|
|
|
|
|
2002-12-01 22:41:22 +00:00
|
|
|
#ifndef S_ISREG
|
2019-04-17 06:17:24 +02:00
|
|
|
# define S_ISREG(x) (((x)&_S_IFREG) == _S_IFREG)
|
2002-12-01 22:41:22 +00:00
|
|
|
#endif
|
|
|
|
#ifndef S_ISDIR
|
2019-04-17 06:17:24 +02:00
|
|
|
# define S_ISDIR(x) (((x)&_S_IFDIR) == _S_IFDIR)
|
2002-12-01 22:41:22 +00:00
|
|
|
#endif
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2009-09-06 13:20:05 +00:00
|
|
|
/* defines for using ISO C++ conformant names */
|
2015-12-10 11:49:53 +01:00
|
|
|
#if !defined(_MSC_VER) || _MSC_VER < 1900
|
|
|
|
# define snprintf _snprintf
|
|
|
|
#endif
|
2009-09-06 13:20:05 +00:00
|
|
|
|
2017-05-27 15:34:55 -04:00
|
|
|
#if defined(_MSC_VER)
|
2019-04-17 06:17:24 +02:00
|
|
|
# define R_OK 4
|
|
|
|
# define W_OK 2
|
2013-03-13 19:48:07 +00:00
|
|
|
// not accepted by access() on windows
|
2019-04-17 06:17:24 +02:00
|
|
|
//# define X_OK 1
|
|
|
|
# define F_OK 0
|
2013-03-05 07:39:52 +00:00
|
|
|
#endif
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
typedef unsigned int mode_t;
|
|
|
|
|
2009-09-24 10:04:43 +00:00
|
|
|
#ifndef _SSIZE_T_
|
2012-04-15 07:54:07 +00:00
|
|
|
# define _SSIZE_T_
|
2009-09-24 10:41:28 +00:00
|
|
|
/* python uses HAVE_SSIZE_T */
|
2012-04-15 07:54:07 +00:00
|
|
|
# ifndef HAVE_SSIZE_T
|
|
|
|
# define HAVE_SSIZE_T 1
|
2009-09-24 10:41:28 +00:00
|
|
|
typedef long ssize_t;
|
2012-04-15 07:54:07 +00:00
|
|
|
# endif
|
2009-09-24 10:04:43 +00:00
|
|
|
#endif
|
2009-09-24 09:29:59 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
struct dirent {
|
2019-04-17 06:17:24 +02:00
|
|
|
int d_ino;
|
|
|
|
int d_off;
|
|
|
|
unsigned short d_reclen;
|
|
|
|
char *d_name;
|
2002-10-12 11:37:38 +00:00
|
|
|
};
|
|
|
|
|
2015-06-16 09:40:17 +10:00
|
|
|
/* intentionally opaque to users */
|
|
|
|
typedef struct __dirstream DIR;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2012-05-12 20:39:39 +00:00
|
|
|
DIR *opendir(const char *path);
|
2002-10-12 11:37:38 +00:00
|
|
|
struct dirent *readdir(DIR *dp);
|
2012-05-12 20:39:39 +00:00
|
|
|
int closedir(DIR *dp);
|
2014-01-14 23:57:00 +02:00
|
|
|
|
|
|
|
void RegisterBlendExtension(void);
|
2008-04-29 21:43:17 +00:00
|
|
|
void get_default_root(char *root);
|
|
|
|
int check_file_chars(char *filename);
|
2012-04-12 02:50:21 +00:00
|
|
|
const char *dirname(char *path);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2008-12-20 10:02:00 +00:00
|
|
|
int BLI_getInstallationDir(char *str);
|
|
|
|
|
2008-08-22 15:00:30 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#endif /* __BLI_WINSTUFF_H__ */
|