utils.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Useful functions for winegcc
  3. *
  4. * Copyright 2000 Francois Gouget
  5. * Copyright 2002 Dimitrie O. Paun
  6. * Copyright 2003 Richard Cohen
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  21. */
  22. #include "../tools.h"
  23. #ifndef DECLSPEC_NORETURN
  24. # if defined(_MSC_VER) && (_MSC_VER >= 1200) && !defined(MIDL_PASS)
  25. # define DECLSPEC_NORETURN __declspec(noreturn)
  26. # elif defined(__GNUC__)
  27. # define DECLSPEC_NORETURN __attribute__((noreturn))
  28. # else
  29. # define DECLSPEC_NORETURN
  30. # endif
  31. #endif
  32. void DECLSPEC_NORETURN error(const char* s, ...);
  33. typedef enum {
  34. file_na, file_other, file_obj, file_res, file_rc,
  35. file_arh, file_dll, file_so, file_def, file_spec
  36. } file_type;
  37. void create_file(const char* name, int mode, const char* fmt, ...);
  38. file_type get_file_type(const char* filename);
  39. file_type get_lib_type(struct target target, struct strarray path, const char *library,
  40. const char *prefix, const char *suffix, char** file);
  41. const char *find_binary( struct strarray prefix, const char *name );
  42. int spawn(struct strarray prefix, struct strarray arr, int ignore_errors);
  43. extern int verbose;