Make fltkutil.cpp independent of FLTK and rename it to unixutil.cpp.

fltkutil.cpp should be independent of FLTK so that it can be linked
into libslvs while neither requiring every user of the library to
reimplement these support routines nor requiring linking in FLTK.
This commit is contained in:
whitequark 2015-03-17 18:09:59 +03:00
parent 5db5f1e152
commit b68631ee56
2 changed files with 5 additions and 7 deletions

View File

@ -32,7 +32,7 @@ if(WIN32)
win32/w32util.cpp) win32/w32util.cpp)
else() else()
set(util_SOURCES set(util_SOURCES
fltk/fltkutil.cpp) unix/unixutil.cpp)
endif() endif()
# libslvs # libslvs

View File

@ -1,5 +1,5 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Utility functions used by the FLTK port. Notably, our memory allocation; // Utility functions used by the Unix port. Notably, our memory allocation;
// we use two separate allocators, one for long-lived stuff and one for // we use two separate allocators, one for long-lived stuff and one for
// stuff that gets freed after every regeneration of the model, to save us // stuff that gets freed after every regeneration of the model, to save us
// the trouble of freeing the latter explicitly. // the trouble of freeing the latter explicitly.
@ -13,8 +13,6 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <FL/filename.H>
#include "solvespace.h" #include "solvespace.h"
void dbp(const char *str, ...) void dbp(const char *str, ...)
@ -31,9 +29,9 @@ void dbp(const char *str, ...)
void GetAbsoluteFilename(char *file) void GetAbsoluteFilename(char *file)
{ {
char absoluteFile[PATH_MAX]; char expanded[MAX_PATH];
fl_filename_absolute(absoluteFile, sizeof(absoluteFile), file); realpath(file, expanded);
strcpy(file, absoluteFile); strcpy(file, expanded);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------