Skip to content

Commit

Permalink
Linux: disabled alfont_get_string function
Browse files Browse the repository at this point in the history
alfont_get_string is a part of alfont 2.* library. It's current implementation uses malloc_usable_size function that is non-standard and may cause linking issues under some circumstances.
Since this particular function is not used anywhere in the engine, it is safer to remove it from compilation for now.
  • Loading branch information
ivan-mogilko committed Aug 18, 2017
1 parent 5c66c61 commit 7b19ffb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Engine/libsrc/alfont-2.0.9/alfont.c
Expand Up @@ -21,20 +21,12 @@
#include <iconv.h>
#else //run in Other
#include <locale.h>
#include <malloc.h>
#include <wchar.h>
#endif

#include FT_FREETYPE_H
#include FT_GLYPH_H

#define _msize malloc_usable_size

#ifdef IOS_VERSION
// Defined in libc.c as a stub method
size_t malloc_usable_size (void *ptr);
#endif

/* structs */

struct ALFONT_FONT {
Expand Down Expand Up @@ -4259,6 +4251,12 @@ int alfont_ugetxc(ALFONT_FONT *f, const char **s) {
return character;
}

// Following function alfont_get_string is removed from compilation because it
// is implemented with the use of non-standart malloc_usable_size function
// (defined as _msize). This may cause linking errors on some Linux systems or
// if using particular compilers.
#if 0

void alfont_get_string(ALFONT_FONT *f, const char *s , char **out){
char *lpszW;
char *lpszW_pointer=NULL; //used for freeing string
Expand Down Expand Up @@ -4509,6 +4507,8 @@ void alfont_get_string(ALFONT_FONT *f, const char *s , char **out){
}
}

#endif // DISABLED

int alfont_need_uconvert(ALFONT_FONT *f, const char *str) {
char *lpszW;
char *str_pointer=NULL; //used for original string fixed by autofix
Expand Down

1 comment on commit 7b19ffb

@rofl0r

This comment was marked as abuse.

Please sign in to comment.