Page MenuHome

Add C internal version of msgfmt (similar to makesrna/dna binaries).
ClosedPublic

Authored by Bastien Montagne (mont29) on Apr 7 2017, 10:52 AM.

Details

Summary

Should hopefully fix performance issues of C++ one with Windows MSVC
debug builds...

Merely a translation from msgfmt.cc code by @Sergey Sharybin (sergey), using BLI libs
intead of C++'s stdlib.

Note: alternative potential solution to D2601.

Diff Detail

Repository
rB Blender
Branch
msgfmt-to-C
Build Status
Buildable 525
Build 525: arc lint + arc unit

Event Timeline

@Ray Molenkamp (LazyDodo) especially need confirmation it works as expected under windows ;)

Also, obviously changes to BLI will be committed separately.

intern/locale/CMakeLists.txt
62

will be removed! sorry about that.

  • Cleanup (remove msgfmt.cc and related CMake pieces).

I haven't validated the output, however the results look great!

source/blender/blentranslation/msgfmt/CMakeLists.txt
43
target_link_libraries(msgfmt ${ZLIB_LIBRARIES})
44

also needs

target_link_libraries(msgfmt bf_intern_utfconv)
target_link_libraries(msgfmt ${PLATFORM_LINKLIBS})
source/blender/blentranslation/msgfmt/msgfmt.c
51
#include "BKE_global.h"
struct Global G;

needed because winstuff.c in blenlib references G.Background a few times in the .blend registration functions, will never be called so no need to init it any further, however we still need a G to resolve the linker error.

438
MEM_freeN((void*)output);

freeing a const seemed sketchy to msvc,

Bastien Montagne (mont29) marked 2 inline comments as done.
  • Cleanup (remove msgfmt.cc and related CMake pieces).
  • Some cleanup, and make code buildable with msvc.

Updated, please tell me if it works on ugly msvc now ;)

source/blender/blentranslation/msgfmt/msgfmt.c
51

Am not very happy with that include, and think there is other way to hack around this, see updated code and please tell me whether it works with MSVC (did fake-test with gcc, so should work, but...).

438

Just made output non-const then, does not really matter here anyway.

This revision was automatically updated to reflect the committed changes.