Skip to content

Commit

Permalink
Merge pull request #85 from lexxmark/mingw64
Browse files Browse the repository at this point in the history
minor adjustments for increased mingw64 compat
  • Loading branch information
lexxmark authored Jan 21, 2022
2 parents 517e457 + 1476a36 commit 9118533
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
project (winflexbison)

if(NOT MSVC)
message( FATAL_ERROR "Visual Studio Build supported only" )
message( WARNING "Visual Studio Build supported only" )
endif()

add_definitions(-D_CRT_SECURE_NO_WARNINGS)
Expand Down
19 changes: 11 additions & 8 deletions common/m4/lib/clean-temp.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* Temporary directories and temporary files with automatic cleanup.
Copyright (C) 2006, 2011-2021 Free Software Foundation, Inc.
Copyright (C) 2006, 2011-2022 Free Software Foundation, Inc.
Written by Bruno Haible <[email protected]>, 2006.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
Expand Down Expand Up @@ -78,6 +78,11 @@ struct temp_dir
/* More fields are present here, but not public. */
};

/* Remove all registered files and subdirectories inside DIR and DIR itself.
DIR cannot be used any more after this call.
Return 0 upon success, or -1 if there was some problem. */
extern int cleanup_temp_dir (struct temp_dir *dir);

/* Create a temporary directory.
PREFIX is used as a prefix for the name of the temporary directory. It
should be short and still give an indication about the program.
Expand All @@ -89,7 +94,8 @@ struct temp_dir
is shown and NULL is returned. */
extern struct temp_dir * create_temp_dir (const char *prefix,
const char *parentdir,
bool cleanup_verbose);
bool cleanup_verbose)
_GL_ATTRIBUTE_DEALLOC (cleanup_temp_dir, 1);

/* Register the given ABSOLUTE_FILE_NAME as being a file inside DIR, that
needs to be removed before DIR can be removed.
Expand Down Expand Up @@ -130,12 +136,9 @@ extern int cleanup_temp_subdir (struct temp_dir *dir,
Return 0 upon success, or -1 if there was some problem. */
extern int cleanup_temp_dir_contents (struct temp_dir *dir);

/* Remove all registered files and subdirectories inside DIR and DIR itself.
DIR cannot be used any more after this call.
Return 0 upon success, or -1 if there was some problem. */
extern int cleanup_temp_dir (struct temp_dir *dir);

#if !defined (__GNUC__) && !defined (__clang__)
typedef int mode_t;
#endif

/* ================== Opening and closing temporary files ================== */

Expand Down
11 changes: 8 additions & 3 deletions common/misc/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,29 @@
#define _GL_ATTRIBUTE_COLD
#define _GL_ASYNC_SAFE
#define GNULIB_XALLOC_DIE 1
#define _GL_HAVE__STATIC_ASSERT
#define _GL_HAVE__STATIC_ASSERT 1
#define _Static_assert(a, b)
#define __PGI

#define MIN min
#define _GL_CMP(a, b) (a) == (b)

#define __getopt_argv_const
#if !defined (__MSYS__) && !defined (__MINGW32__) /* defined in sys/cdefs.h */
#define _Noreturn
#endif

#ifndef _GL_INLINE
#define _GL_INLINE inline
#endif

/* should be set by including "filename.h"
#ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
#define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
#endif
#endif */

#if !defined (__MSYS__) && !defined (__MINGW32__) /* defined in sys/stat.h */
#define S_ISDIR(mode) (mode & _S_IFDIR)
#endif

extern char* _stpcpy(char *yydest, const char *yysrc);
extern char* _stpcpy(char *yydest, const char *yysrc);

0 comments on commit 9118533

Please sign in to comment.