Fix CSGO build.
1 /** vim: set ts=4 sw=4 et tw=99:
3 * === Stripper for Metamod:Source ===
4 * Copyright (C) 2005-2009 David "BAILOPAN" Anderson
5 * No warranties of any kind.
6 * Based on the original concept of Stripper2 by botman
8 * License: see LICENSE.TXT
9 * ===================================
19 #include <sys/types.h>
25 stripper_game_t stripper_game;
28 #define EXPORT extern "C" __declspec(dllexport)
29 #elif defined __GNUC__
31 #define EXPORT extern "C" __attribute__ ((visibility("default")))
33 #define EXPORT extern "C"
38 parse_map(const char* map, const char* entities)
43 g_Stripper.SetEntityList(entities);
45 stripper_game.path_format(path,
47 "%s/%s/global_filters.cfg",
48 stripper_game.game_path,
49 stripper_game.stripper_cfg_path);
50 fp = fopen(path, "rt");
53 stripper_game.log_message("Could not find global filter file: %s", path);
58 g_Stripper.ApplyFileFilter(path);
61 stripper_game.path_format(path,
64 stripper_game.game_path,
65 stripper_game.stripper_cfg_path,
67 fp = fopen(path, "rt");
71 g_Stripper.ApplyFileFilter(path);
74 return g_Stripper.ToString();
80 return g_Stripper.ToString();
88 stripper_game.path_format(path,
91 stripper_game.game_path,
92 stripper_game.stripper_path);
95 DWORD attr = GetFileAttributes(path);
96 if ( (attr = INVALID_FILE_ATTRIBUTES) || (!(attr & FILE_ATTRIBUTE_DIRECTORY)) )
104 if (stat(path, &s) != 0)
110 if (!(S_ISDIR(s.st_mode)))
122 stripper_game.path_format(file,
126 stripper_game.get_map_name(),
128 FILE *fp = fopen(file, "rt");
134 FILE *fp = fopen(file, "wt");
135 fprintf(fp, "%s", g_Stripper.ToString());
138 stripper_game.log_message("Logged map %s to file %s", stripper_game.get_map_name(), file);
146 static stripper_core_t stripper_core =
155 LoadStripper(const stripper_game_t* game, stripper_core_t* core)
157 memcpy(&stripper_game, game, sizeof(stripper_game_t));
158 memcpy(core, &stripper_core, sizeof(stripper_core_t));
161 /* Overload a few things to prevent libstdc++ linking */
162 #if defined __linux__ || defined __APPLE__
163 extern "C" void __cxa_pure_virtual(void)
167 void *operator new(size_t size)
172 void *operator new[](size_t size)
177 void operator delete(void *ptr)
182 void operator delete[](void * ptr)