Skip to content
Snippets Groups Projects
Commit f5f1ebfa authored by Oliver Bock's avatar Oliver Bock
Browse files

Using explicit linkage

parent 56b4abbb
No related branches found
No related tags found
No related merge requests found
......@@ -64,7 +64,7 @@ private:
* \todo Does this need to be global?
* Maybe we should wrap a class around the generated resources?
*/
extern const string c_ResourceIdentifiers[];
extern "C++" const string c_ResourceIdentifiers[];
/**
* \brief Declaration of the external list of resource indices
......@@ -78,7 +78,7 @@ extern const string c_ResourceIdentifiers[];
* \todo Does this need to be global?
* Maybe we should wrap a class around the generated resources?
*/
extern const unsigned int c_ResourceIndex[][2];
extern "C++" const unsigned int c_ResourceIndex[][2];
/**
* \brief Declaration of the external resource storage container
......@@ -90,6 +90,6 @@ extern const unsigned int c_ResourceIndex[][2];
* \todo Does this need to be global?
* Maybe we should wrap a class around the generated resources?
*/
extern const unsigned char c_ResourceStorage[];
extern "C++" const unsigned char c_ResourceStorage[];
#endif /*RESOURCEFACTORY_H_*/
......@@ -216,15 +216,15 @@ private:
};
/* Constellation & star coordinates are in starlist.C */
extern float star_info[][2];
extern int Nstars;
extern "C" float star_info[][2];
extern "C" int Nstars;
/* Pulsar coordinates are in pulsar_list.C */
extern float pulsar_info[][2];
extern int Npulsars;
extern "C" float pulsar_info[][2];
extern "C" int Npulsars;
/* SNR coordinates are in snr_list.C */
extern float SNR_info[][2];
extern int NSNRs;
extern "C" float SNR_info[][2];
extern "C" int NSNRs;
#endif /*STARSPHERE_H_*/
......@@ -64,17 +64,17 @@ void ResourceCompiler::compile()
// write code file contents (remove trailing commas)
string output = resourceIdentifierInitializer.str();
outputFile << "std::string c_ResourceIdentifiers[] = {" << endl;
outputFile << "extern \"C++\" const std::string c_ResourceIdentifiers[] = {" << endl;
outputFile << output.substr(0, output.length() - 1);
outputFile << endl << "};" << endl << endl;
output = resourceIndexInitializer.str();
outputFile << "unsigned int c_ResourceIndex[][2] = {" << endl;
outputFile << "extern \"C++\" const unsigned int c_ResourceIndex[][2] = {" << endl;
outputFile << output.substr(0, output.length() - 1);
outputFile << endl << "};" << endl << endl;
output = resourceStorageInitializer.str();
outputFile << "unsigned char c_ResourceStorage[] = {" << endl;
outputFile << "extern \"C++\" const unsigned char c_ResourceStorage[] = {" << endl;
outputFile << output.substr(0, output.length() - 1);
outputFile << endl << "};" << endl << endl;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment