Solved MSWin type conflict UUID

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7487 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2010-04-12 15:15:03 +00:00
parent 9604b556b8
commit 9100fc0b51
4 changed files with 53 additions and 36 deletions

View File

@ -62,11 +62,11 @@
class Maketools_IDE {
char *rootDir;
char projectName[80];
Fl_Preferences tgtAppsDB;
Fl_IDE_Prefs tgtAppsDB;
int nTgtApps;
Fl_Preferences tgtLibsDB;
Fl_IDE_Prefs tgtLibsDB;
int nTgtLibs;
Fl_Preferences tgtTestsDB;
Fl_IDE_Prefs tgtTestsDB;
int nTgtTests;
Fl_Preferences filesDB;
int nFiles;
@ -223,6 +223,15 @@ public:
}
int writeFluidMakefile(const char *filepath) {
int i, n;
Fl_Preferences::ID fluidID = tgtAppsDB.find_by_key("name", "Fluid");
if (!fluidID) {
fprintf(stderr, "Target \"Fluid\" not found!\n");
return -1;
}
Fl_Target_Prefs fluidDB(fluidID);
FILE *f = fopen(filepath, "wb");
fputs("#\n", f);
fputs("# \"$Id: Makefile 6614 2009-01-01 16:11:32Z matt $\"\n", f);
@ -252,6 +261,18 @@ public:
fputs("#\n", f);
fputs("\n", f);
fputs("CPPFILES = \\\n", f);
Fl_Preferences sourcesDB(fluidDB, "sources");
n = sourcesDB.groups();
for (i=0; i<n; i++) {
Fl_Preferences sourceDB(sourcesDB, i);
GET_UUID(refUUID, sourceDB);
Fl_File_Prefs fileDB(filesDB, refUUID);
fprintf(f, "\t%s", fileDB.fullName());
if (i<n-1) fputs(" \\", f);
fputs("\n", f);
}
/*
fputs("\tCodeEditor.cxx \\\n", f);
fputs("\tFl_Function_Type.cxx \\\n", f);
fputs("\tFl_Group_Type.cxx \\\n", f);
@ -275,6 +296,7 @@ public:
fputs("\ttemplate_panel.cxx \\\n", f);
fputs("\tundo.cxx \\\n", f);
fputs("\twidget_panel.cxx\n", f);
*/
fputs("\n", f);
fputs("################################################################\n", f);
fputs("\n", f);

View File

@ -114,7 +114,7 @@
/*
* Read a UUID from a database entry. If none exists, create one in the database.
*/
void getUUID(Fl_Preferences &db, const char *key, char *buffer) {
void fl_getUUID(Fl_Preferences &db, const char *key, char *buffer) {
db.get(key, buffer, "", 37);
if (buffer[0]==0) {
strcpy(buffer, Fl_Preferences::newUUID());
@ -126,7 +126,7 @@ void getUUID(Fl_Preferences &db, const char *key, char *buffer) {
* Read an Xcode ID from a database entry. If none exists, create one in the database.
* The Xcode ID contains 24 bytes of hexadecimal chracters.
*/
void getXCID(Fl_Preferences &db, const char *key, char *buffer) {
void fl_getXCID(Fl_Preferences &db, const char *key, char *buffer) {
db.get(key, buffer, "", 25);
if (buffer[0]==0) {
const char *uuid = Fl_Preferences::newUUID();

View File

@ -32,21 +32,16 @@
#include <FL/Fl_Preferences.H>
#ifndef WIN32
/* Remove this typedef from win32 builds, it seems it clashes
* with existing symbol names. It does not appear to be used. */
typedef char UUID[40];
#endif
typedef char XCID[25];
typedef char Fl_UUID[40];
typedef char Fl_XCID[25];
extern void getUUID(Fl_Preferences &db, const char *key, char *buffer);
extern void getXCID(Fl_Preferences &db, const char *key, char *buffer);
extern void fl_getUUID(Fl_Preferences &db, const char *key, char *buffer);
extern void fl_getXCID(Fl_Preferences &db, const char *key, char *buffer);
/* Shortcut to retrieve or create a UUID from the database */
#define MAKE_UUID(name, db) \
char name[40]; getUUID(db, #name, name);
char name[40]; fl_getUUID(db, #name, name);
/* Shortcut to retrieve, but not create a UUID from the database */
#define GET_UUID(name, db) \
@ -54,7 +49,7 @@ extern void getXCID(Fl_Preferences &db, const char *key, char *buffer);
/* Shortcut to retrieve or create a UUID from the database */
#define MAKE_XCID(name, db) \
char name[25]; getXCID(db, #name, name);
char name[25]; fl_getXCID(db, #name, name);
/* Shortcut to retrieve, but not create a UUID from the database */
#define GET_XCID(name, db) \

View File

@ -115,15 +115,15 @@ class Xcode3_IDE {
Fl_Preferences filesDB;
int nFiles;
Fl_Preferences ideDB;
XCID xcRootNodeID;
XCID xcBuildConfigurationListID;
XCID xcMainGroupID;
XCID xcProductsGroupID;
XCID xcAppsGroupID;
XCID xcLibsGroupID;
XCID xcTestsGroupID;
XCID xcBuildConfigurationDebugID;
XCID xcBuildConfigurationReleaseID;
Fl_XCID xcRootNodeID;
Fl_XCID xcBuildConfigurationListID;
Fl_XCID xcMainGroupID;
Fl_XCID xcProductsGroupID;
Fl_XCID xcAppsGroupID;
Fl_XCID xcLibsGroupID;
Fl_XCID xcTestsGroupID;
Fl_XCID xcBuildConfigurationDebugID;
Fl_XCID xcBuildConfigurationReleaseID;
public:
Xcode3_IDE(Fl_Preferences &db, const char *rootDirA)
: rootDir(strdup(rootDirA)),
@ -138,15 +138,15 @@ public:
nTgtLibs = tgtLibsDB.groups();
nTgtTests = tgtTestsDB.groups();
nFiles = filesDB.groups();
getXCID(ideDB, "xcRootNodeID", xcRootNodeID);
getXCID(ideDB, "xcBuildConfigurationListID", xcBuildConfigurationListID);
getXCID(ideDB, "xcMainGroupID", xcMainGroupID);
getXCID(ideDB, "xcProductsGroupID", xcProductsGroupID);
getXCID(ideDB, "xcAppsGroupID", xcAppsGroupID);
getXCID(ideDB, "xcLibsGroupID", xcLibsGroupID);
getXCID(ideDB, "xcTestsGroupID", xcTestsGroupID);
getXCID(ideDB, "xcBuildConfigurationDebugID", xcBuildConfigurationDebugID);
getXCID(ideDB, "xcBuildConfigurationReleaseID", xcBuildConfigurationReleaseID);
fl_getXCID(ideDB, "xcRootNodeID", xcRootNodeID);
fl_getXCID(ideDB, "xcBuildConfigurationListID", xcBuildConfigurationListID);
fl_getXCID(ideDB, "xcMainGroupID", xcMainGroupID);
fl_getXCID(ideDB, "xcProductsGroupID", xcProductsGroupID);
fl_getXCID(ideDB, "xcAppsGroupID", xcAppsGroupID);
fl_getXCID(ideDB, "xcLibsGroupID", xcLibsGroupID);
fl_getXCID(ideDB, "xcTestsGroupID", xcTestsGroupID);
fl_getXCID(ideDB, "xcBuildConfigurationDebugID", xcBuildConfigurationDebugID);
fl_getXCID(ideDB, "xcBuildConfigurationReleaseID", xcBuildConfigurationReleaseID);
}
~Xcode3_IDE() {
if (rootDir) free(rootDir);
@ -752,11 +752,11 @@ public:
MAKE_XCID(xcTargetID, targetDB);
MAKE_XCID(xcBuildConfigurationListID, targetDB);
char xcBuildHeadersID[25], xcBuildCopyFilesID[25];
if (fmwk) getXCID(targetDB, "xcBuildHeadersID", xcBuildHeadersID);
if (fmwk) fl_getXCID(targetDB, "xcBuildHeadersID", xcBuildHeadersID);
MAKE_XCID(xcBuildResourcesID, targetDB);
MAKE_XCID(xcBuildSourcesID, targetDB);
MAKE_XCID(xcBuildFrameworksID, targetDB);
if (!fmwk) getXCID(targetDB, "xcBuildCopyFilesID", xcBuildCopyFilesID);
if (!fmwk) fl_getXCID(targetDB, "xcBuildCopyFilesID", xcBuildCopyFilesID);
MAKE_XCID(xcProductID, targetDB);
MAKE_XCID(xcBuildRuleFlID, targetDB);
fprintf(out, "\t\t%s /* %s */ = {\n", xcTargetID, name);