2
0
mirror of https://github.com/rehlds/metamod-r.git synced 2024-12-26 06:35:33 +03:00

Fixed compilation

This commit is contained in:
s1lentq 2017-01-18 03:51:43 +07:00
parent 274e7cef8e
commit f2b842b795
6 changed files with 14 additions and 10 deletions

View File

@ -47,6 +47,8 @@ void setupToolchain(NativeBinarySpec b)
pchHeader: 'precompiled.h',
pchSourceSet: 'rmod_pch'
)
cfg.extraLibs 'psapi.lib'
cfg.singleDefines('_CRT_SECURE_NO_WARNINGS')
} else if (cfg instanceof GccToolchainConfig) {
cfg.compilerOptions.pchConfig = new GccToolchainConfig.PrecompilerHeaderOptions(
@ -99,7 +101,7 @@ model {
components {
metamod(NativeLibrarySpec) {
targetPlatform 'x86'
baseName GradleCppUtils.windows ? 'metamod_mm' : 'metamod_mm_i386'
baseName GradleCppUtils.windows ? 'metamod' : 'metamod_i386'
sources {
rmod_pch(CppSourceSet) {

View File

@ -421,8 +421,8 @@ char *MPlugin::resolve_suffix(char *path) const
}
#ifndef _WIN32
for (size_t i = 0; i < arraysize(g_platform_suffixes); i++) {
Q_snprintf(tmpbuf, sizeof tmpbuf, "%s%s", path, g_platform_suffixes[i]);
for (size_t i = 0; i < arraysize(g_platform_postfixes); i++) {
Q_snprintf(tmpbuf, sizeof tmpbuf, "%s%s", path, g_platform_postfixes[i]);
if ((found = check(tmpbuf))) return found;
}
#endif
@ -1393,7 +1393,7 @@ const char *MPlugin::str_source(STR_SOURCE fmt) const
else
{
if (fmt == SO_SHOW) return UTIL_VarArgs("pl%d", m_source_plugin_index);
else return UTIL_VarArgs("plugin [%s]", g_plugins.find(m_source_plugin_index)->m_desc);
else return UTIL_VarArgs("plugin [%s]", g_plugins->find(m_source_plugin_index)->m_desc);
}
default:
if (fmt == SO_SHOW) return UTIL_VarArgs("UNK%d", m_source);

View File

@ -120,7 +120,7 @@ const char* CSysModule::getloaderror()
#ifdef _WIN32
return str_GetLastError();
#else
return dlerror;
return dlerror();
#endif
}

View File

@ -141,6 +141,7 @@ bool is_absolute_path(const char *path)
return false;
}
#ifdef _WIN32
char *realpath(const char *file_name, char *resolved_name)
{
int ret = GetFullPathName(file_name, PATH_MAX, resolved_name, NULL);
@ -166,3 +167,4 @@ char *realpath(const char *file_name, char *resolved_name)
return NULL;
}
#endif // _WIN32

View File

@ -50,9 +50,9 @@ const char* LOCALINFO(char* key);
#ifdef _WIN32
char *mm_strtok_r(char *s, const char *delim, char **ptrptr);
#endif
char *realpath(const char *file_name, char *resolved_name);
#endif // _WIN32
char* trimbuf(char *str);
void normalize_pathname(char *path);
bool is_absolute_path(const char *path);
char *realpath(const char *file_name, char *resolved_name);

View File

@ -21,9 +21,9 @@ task publishPrepareFiles << {
pubRootDir.mkdirs()
project.file('publish/publishRoot/metamod/addons/metamod').mkdirs()
_copyFileToDir('publish/metamod_mm.dll', 'publish/publishRoot/metamod/addons/metamod/')
//_copyFileToDir('publish/metamod_mm.pdb', 'publish/publishRoot/metamod/addons/metamod/')
_copyFile('publish/libmetamod_mm_i386.so', 'publish/publishRoot/metamod/addons/metamod/metamod_mm_i386.so')
_copyFileToDir('publish/metamod.dll', 'publish/publishRoot/metamod/addons/metamod/')
//_copyFileToDir('publish/metamod.pdb', 'publish/publishRoot/metamod/addons/metamod/')
_copyFile('publish/libmetamod_i386.so', 'publish/publishRoot/metamod/addons/metamod/metamod_i386.so')
}
task publishPackage(type: Zip, dependsOn: 'publishPrepareFiles') {