]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ftepp.c
Update deps
[xonotic/gmqcc.git] / ftepp.c
diff --git a/ftepp.c b/ftepp.c
index f6c850c80a037d885eb6851caada693bd5f513f6..fe63fbf656cb9c172ee060abf7f68b3d4a8aaa01 100644 (file)
--- a/ftepp.c
+++ b/ftepp.c
@@ -21,7 +21,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#include <time.h>
 #include <string.h>
 #include <stdlib.h>
 #include <sys/stat.h>
@@ -30,6 +29,7 @@
 #include "lexer.h"
 
 #define HT_MACROS 1024
+
 typedef struct {
     bool on;
     bool was_on;
@@ -92,7 +92,7 @@ static char *ftepp_predef_date(lex_file *context) {
     (void)context;
 
     time (&rtime);
-    itime = platform_localtime(&rtime);
+    itime = util_localtime(&rtime);
     strftime(value, 82, "\"%b %d %Y\"", itime);
 
     return value;
@@ -107,7 +107,7 @@ static char *ftepp_predef_time(lex_file *context) {
     (void)context;
 
     time (&rtime);
-    itime = platform_localtime(&rtime);
+    itime = util_localtime(&rtime);
     strftime(value, 82, "\"%X\"", itime);
 
     return value;
@@ -123,7 +123,7 @@ static char *ftepp_predef_line(lex_file *context) {
 static char *ftepp_predef_file(lex_file *context) {
     size_t  length = strlen(context->name) + 3; /* two quotes and a terminator */
     char   *value  = (char*)mem_a(length);
-    platform_snprintf(value, length, "\"%s\"", context->name);
+    util_snprintf(value, length, "\"%s\"", context->name);
 
     return value;
 }
@@ -171,7 +171,7 @@ static char *ftepp_predef_timestamp(lex_file *context) {
     if (stat(context->name, &finfo))
         return util_strdup("\"<failed to determine timestamp>\"");
 
-    find = platform_ctime(&finfo.st_mtime);
+    find = util_ctime(&finfo.st_mtime);
     value = (char*)mem_a(strlen(find) + 1);
     memcpy(&value[1], find, (size = strlen(find)) - 1);
 
@@ -864,7 +864,7 @@ static bool ftepp_macro_expand(ftepp_t *ftepp, ppmacro *macro, macroparam *param
 
     if (resetline && !ftepp->in_macro) {
         char lineno[128];
-        platform_snprintf(lineno, 128, "\n#pragma line(%lu)\n", (unsigned long)(old_lexer->sline));
+        util_snprintf(lineno, 128, "\n#pragma line(%lu)\n", (unsigned long)(old_lexer->sline));
         ftepp_out(ftepp, lineno, false);
     }
 
@@ -1274,7 +1274,7 @@ static void unescape(const char *str, char *out) {
 
 static char *ftepp_include_find_path(const char *file, const char *pathfile)
 {
-    FILE       *fp;
+    fs_file_t  *fp;
     char       *filename = NULL;
     const char *last_slash;
     size_t      len;
@@ -1464,7 +1464,7 @@ static bool ftepp_include(ftepp_t *ftepp)
 
     ftepp_out(ftepp, "\n#pragma file(", false);
     ftepp_out(ftepp, ctx.file, false);
-    platform_snprintf(lineno, sizeof(lineno), ")\n#pragma line(%lu)\n", (unsigned long)(ctx.line+1));
+    util_snprintf(lineno, sizeof(lineno), ")\n#pragma line(%lu)\n", (unsigned long)(ctx.line+1));
     ftepp_out(ftepp, lineno, false);
 
     /* skip the line */
@@ -1843,12 +1843,12 @@ ftepp_t *ftepp_create()
         minor[2] = '"';
     } else if (OPTS_OPTION_U32(OPTION_STANDARD) == COMPILER_GMQCC) {
         ftepp_add_define(ftepp, NULL, "__STD_GMQCC__");
-        platform_snprintf(major, 32, "\"%d\"", GMQCC_VERSION_MAJOR);
-        platform_snprintf(minor, 32, "\"%d\"", GMQCC_VERSION_MINOR);
+        util_snprintf(major, 32, "\"%d\"", GMQCC_VERSION_MAJOR);
+        util_snprintf(minor, 32, "\"%d\"", GMQCC_VERSION_MINOR);
     } else if (OPTS_OPTION_U32(OPTION_STANDARD) == COMPILER_QCCX) {
         ftepp_add_define(ftepp, NULL, "__STD_QCCX__");
-        platform_snprintf(major, 32, "\"%d\"", GMQCC_VERSION_MAJOR);
-        platform_snprintf(minor, 32, "\"%d\"", GMQCC_VERSION_MINOR);
+        util_snprintf(major, 32, "\"%d\"", GMQCC_VERSION_MAJOR);
+        util_snprintf(minor, 32, "\"%d\"", GMQCC_VERSION_MINOR);
     } else if (OPTS_OPTION_U32(OPTION_STANDARD) == COMPILER_QCC) {
         ftepp_add_define(ftepp, NULL, "__STD_QCC__");
         /* 1.0 */