Commit Graph

140 Commits

Author SHA1 Message Date
5513da65b2 Cleanup: trailing space for BLI 2018-06-17 16:32:54 +02:00
28d2148b09 Haiku OS Support
D2860 by @miqlas

Even though Haiku is a niche OS, only minor changes are needed.
2017-11-30 18:05:21 +11:00
8ac69ff9dc Cleanup: use uint type in BLI 2017-10-28 17:48:45 +11:00
9f044cb422 Remove MinGW support
The Issue
=======

For a long time now MinGW has been unsupported and unmaintained and at this point,
it looks like something that we should just leave behind and move on.


Why Remove
==========

One of the big motivations for MinGW back in the day is that it was free compared to MSVC which was licensed based.
However, now that this is no longer true we have basically stopped updating the need CMake files.
Along with the CMake files, there are several patches to the extern libs needed to make this work.  For example, see:
https://developer.blender.org/diffusion/B/browse/master/extern/carve/patches/mingw_w64.patch

If we wanted to keep MinGW then we would need to make more custom patches to the external libs and
this is not something our platform maintainers are willing to do.

For example, here is the patches needed to build python: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-python3

Fixes T51301

Differential Revision: https://developer.blender.org/D2648
2017-05-27 15:34:55 -04:00
622019a085 Fix BLI_rename returned success w/ missing source path 2016-02-03 15:57:24 +11:00
6f1c44e611 Some fixes from coverity (only one really nasty, in paint_proj). 2015-12-28 16:09:06 +01:00
24d2e46296 Add missing newlines for debug prints 2015-11-16 15:19:30 +11:00
Julian Eisel
ef629e0d50 Quiet warnings
We had too many warnings lately... was awaiting that someone would kill them - didn't happen -> goes to my commit ratio! :P
2015-09-04 01:04:37 +02:00
c5018c65b9 BLI_fileops: Some fixes and cleanup.
* Fix BLI_file_touch, used to add one dummy byte ((unsigned char)EOF) to empty files!
* Get rid of static global temp string in WIN32 area (very bad, and useless!).
* Get rid of paranoid NULL checks in WIN32's BLI_gzopen().
* Add non-relative filename asserts to WIN32 file operations too.
* ifdef-out BLI_move and BLI_create_symlink, unused (and the later is not even implemented for windows).

Partly based on patch and points raised by Jason Wilkins (jwilkins) in T32870, thanks!
2015-08-24 22:14:38 +02:00
66365589ff Hopefully fix mingw building after filebrowser rewrite.
The mystery here is, how MSVC could not break on such error? :(
2015-08-20 10:15:08 +02:00
2daa4db8a0 Fix own stupid error in yesterday's refactor of recursive dir creation.
Missed adding return value in one place.

Thanks a lot to Thomas Szepe for reporting the issue and finding the solution!

Question remains: how could MSVC allow such a code to compile in some cases
(own win64 + scons buildbot win32 were OK with that it seems!).
Crappy compiler, not comming to the rescue of stupid dev...
2015-07-15 17:43:04 +02:00
d0c5eac4b7 BLI_fileops: Make BLI_dir_create_recursive() return success/error status.
Handy to know directly whether a file creation succeeded or not.

Also, made a few more changes in this func, and harmonized a bit win32/*nix versions.
2015-07-14 18:57:38 +02:00
feffbe974b Remove redundant string copy 2015-07-13 03:43:41 +10:00
1893e5e4c2 Missed essential part in previous commit.
Or how to epic fail a fix when working on two different systems.
Or how to increase your commit rate.
2015-07-12 19:04:31 +02:00
7e9c347c8c Fix T45375: Cant clear temp fluid cache after closing Blender (Windows).
There was two different issues here actually:
* Own (very high) stupidity only gave 8 chars to file name (sic).
* list dir returns dirpaths without a trailing slahs, but expects them to have it it seems. :|
2015-07-12 18:49:02 +02:00
28c34d332f Assert when relative paths are passed to IO ops
This is typically an error (& hangs a few seconds on win32), best catch early.
2015-06-18 12:49:10 +10:00
7bc6fbf158 Cleanup: current/parent paths: add helpers in BLI_path_utils.
Also, avoid calling ugly strcmp with '.' or '..', making direct char checks is
much cheaper here!
2015-01-26 16:59:24 +01:00
fca515838e Cleanup: strcmp/strncmp -> STREQ/STREQLEN (in boolean usage).
Makes usage of those funcs much more clear, we even had mixed '!strcmp(foo, bar)'
and 'strcmp(foo, bar) == 0' in several places...
2015-01-26 16:59:24 +01:00
b137f06d7e Cleanup: rename 'filelist' BLI funcs to consistent naming.
Also, add an optional callback to `BLI_filelist_free()` to allow freein
void poin if needed (consistency with `BLI_filelist_duplicate()`...).
2015-01-03 12:41:36 +01:00
aab4f2b762 cleanup: redundant casts & const cast correctness 2015-01-01 23:42:28 +11:00
15d39eaac1 Write Compressed blend files directly
Writing compressed files would write the uncompressed blend, then re-compress on-disk.

Use a wrapper for open/write/close commands
2014-09-04 21:54:24 +10:00
a4d9c8f579 Code cleanup: casts, dead assignment & arg order. 2014-06-26 15:46:42 +10:00
65bb121401 Fix compilation on OSX after own rB414c70435dcd...
Sigh, why can't all unix have same includes? :/
2014-06-24 08:31:29 +02:00
7e7a85f907 Fix own typo in temp_data patch, (windows-only)
Don't know when this sneaked in, I did wrote that part of the patch on win VM with MSVC2013... :/

Note: letting asside warnings for now, then should not prevent building anyway.
2014-06-23 16:56:35 +02:00
414c70435d T39690: Modifications to Blender's 'temp dir' system.
Current temporary data of Blender suffers one major issue - default 'temp' dir on Windows is never
automatically cleaned up, and can end being quite big when used by Blender, especially when we have
to store per-process data (using getpid() in file names).

To address this, this patch:
* Divides tempdir paths in two, one for 'base' temp dir (the same as previous unique tempdir path),
  the other is a mkdtemp-generated sub-dir, specific to each Blender instance.
* Only uses base tempdir when we need some shallow persistance accross Blender sessions - and we always
  reuse the same filename (quit.blend...) or generate small file (crash reports...).
* Uses temp sub-dir for heavy files like pointcache or renderEXRs (Save Buffer option).
* Erases temp sub-dir on quit or crash.

To get this working it also adds a working 'recursive delete' to BLI_delete() under Windows.

Note that, as in current code, the 'recover render result' hack-feature that was possible
with SaveBuffer option is still removed. A real renderresult cache feature will be added
soon, though.

Reviewers: campbellbarton, brecht, sergey

Reviewed By: campbellbarton, sergey

CC: sergey

Differential Revision: https://developer.blender.org/D531
2014-06-23 13:42:54 +02:00
6b7bee6cd7 Fix for BLI_delete failing on files containing quotes 2014-05-26 10:23:05 +10:00
4ca67869cc Code cleanup: remove unused includes
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
551096d6fd BLI_open: check returned value for -1 instead of < 0 2014-04-22 16:40:17 +10:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
2097e621ed Code cleanup: use r_ prefix for return args 2014-03-16 03:26:23 +11:00
9e561a641e remove callback BLI_localErrorCallBack from scanfill, was here for years and only ever wrapped printf. 2013-08-28 02:14:24 +00:00
0cb9a83113 code cleanup: remove unused code 2013-07-27 18:17:19 +00:00
ec3fce8e27 add api function BLI_path_append to add to a path (and ensure a seperator), replaces BLI_join_dirfile when the dir and the destimation were the same. 2013-07-24 21:25:06 +00:00
925c5010e8 fix for checking char arrays against NULL, instead check their first character. also remove some dead code (return directly after return). 2013-07-16 11:42:07 +00:00
40d4dfaba8 Fix #35824: finding missing files not working correct for filepaths with special
characters on Windows.

Replaced some uses of stat() by BLI_stat() to properly handle such filepaths.
2013-06-25 14:48:30 +00:00
225c5fee6b move BLO_sys_types.h -> BLI_sys_types.h (it had nothing todo with loading)
remove MEM_sys_types.h which was a duplicate.
2013-05-28 19:35:26 +00:00
28ecc1ce20 fix for building with mingw 2013-05-13 05:40:51 +00:00
34b5bd7283 Fix #35081: opening .blend files with chinese characters not working. For
compressed files we were not passing the full wide char path to zlib, so not
all file names worked. Now we use gzopen_w available in new zlib versions.

Patch by Tamito Kajiyama, I added an extra check for the zlib version so it
keeps compiling with older versions for now.


For platform maintainers:

Part of this commit are zlib 1.2.8 libraries for windows 32 bit. We still
need update libraries for windows 64 bit and mingw. There's a readme.txt
and build.bat included with instructions on how to build.
2013-05-01 17:43:33 +00:00
5d234f0a0b code cleanup: includes 2013-04-01 11:27:47 +00:00
10b4a86dbf code cleanup: quiet warnings building with mingw. 2013-03-29 00:50:52 +00:00
a79e10157d code cleanup: use NULL rather then 0 for pointers, and make vars static where possible.
also found unintentionally defined enum/struct variables that where only meant to be defining the type.
2013-03-22 05:34:10 +00:00
dcbfa25bc8 Fix #34551: blender crash rendering with save buffers.
Problem was the new usage of access() on Windows, this doesn't accept X_OK. Also wrapped _waccess so that UTF-8 paths work.
2013-03-13 19:48:07 +00:00
35b9fcb871 comment unused BLI_move() function, also fixed error where it would delete the file even if renaming failed.
- found when testing recursive_operation().
2013-03-09 09:52:38 +00:00
edf4855a38 patch [#34103] fileops_recursive_operation.patch
from Lawrence D'Oliveiro (ldo)

Fix potential memory leaks in recursive_operation while simplifying cleanup logic.
2013-03-09 09:38:27 +00:00
ddddb7bab1 code cleanup: favor braces when blocks have mixed brace use. 2013-03-09 03:46:30 +00:00
384948908a patch [#34103] path_util_split_dirstring.patch, path_util_split_dirstring_2.patch, path_util_split_dirstring_3.patch
from Lawrence D'Oliveiro (ldo)

Get rid of BLI_splitdirstring, replace with calls to BLI_split_dirfile, BLI_split_dir_part and BLI_split_file_part as appropriate.
2013-03-05 06:26:10 +00:00
b8315afeed patch [#34103] fileops_file_is_writable.patch, fileops_file_is_writable_2.patch
from Lawrence D'Oliveiro (ldo)

More efficient implementation of BLI_file_is_writable using access(2) instead of actually opening file.
2013-03-05 03:59:38 +00:00
e39f05e5fa patch [#34103] fileops_1.patch
from Lawrence D'Oliveiro (ldo) 

Add comments and use of bool type in fileops.c
2013-03-05 03:53:22 +00:00
0d5b028d43 patch [#34103] use boolean in path functions and add comments.
path_util_1.patch from Lawrence D'Oliveiro (ldo)
2013-03-04 19:27:51 +00:00
2005f7c6c0 style cleanup: also some typos 2013-02-11 00:49:00 +00:00