summaryrefslogtreecommitdiff
path: root/src/Fl_Preferences.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2010-01-04 09:40:25 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2010-01-04 09:40:25 +0000
commit1a9b7d72d2706d6d3083363af3aeb2152ea152f7 (patch)
tree6e1c52db520f59d4f49efdc03fb0de5005d83f39 /src/Fl_Preferences.cxx
parentb08153975c2b4faa052ab678b9d38f156a32b9e3 (diff)
Temporary fix for Fl_Preferences on Windows, because gethostbyname would need
winsock (ws2_32.dll) - the final fix would have to load it dynamically or use another function... Also fixed the missing return statement (all platforms). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6987 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Preferences.cxx')
-rw-r--r--src/Fl_Preferences.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx
index a1c332465..ffa497f9c 100644
--- a/src/Fl_Preferences.cxx
+++ b/src/Fl_Preferences.cxx
@@ -103,7 +103,9 @@ const char *Fl_Preferences::newUUID()
b[11] = (unsigned char)(a>>24);
char name[80]; // last four bytes
// BOOL GetComputerName(LPTSTR lpBuffer, LPDWORD nSize);
- gethostname(name, 79);
+#warning gethostbyname needs winsock!
+ // gethostname(name, 79); // A.S. temporarily replaced by:
+ strcpy (name,"localhost"); // A.S. fix gethostbyname
memcpy(b+12, name, 4);
sprintf(uuidBuffer, "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X",
b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7],
@@ -135,6 +137,8 @@ const char *Fl_Preferences::newUUID()
b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7],
b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15]);
#endif
+
+ return uuidBuffer;
}