Welcome to mirror list, hosted at ThFree Co, Russian Federation.

platform.h « platform « src - github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 21c20c0cc9e0e1ce9f75f600f298029f75785d7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**
 * \file   platform.h
 * \brief  Platform abstraction API.
 * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
 */
#if !defined(PREMAKE_PLATFORM_H)
#define PREMAKE_PLATFORM_H


/* Determine the current OS. I'm not sure how to reliably detect Windows
 * but since it is the most common I use it as the default */
#if defined(__linux__)
#define PLATFORM_LINUX 1
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#define PLATFORM_BSD 1
#elif defined(__APPLE__) && defined(__MACH__)
#define PLATFORM_MACOSX 1
#else
#define PLATFORM_WINDOWS 1
#endif


/**
 * Create a directory, if it doesn't exist already.
 * \returns OKAY if successful.
 */
int platform_create_dir(const char* path);


/**
 * Get the current working directory.
 * \param   buffer    A buffer to hold the directory.
 * \param   size      The size of the buffer.
 * \returns OKAY if successful.
 */
int platform_dir_get_current(char* buffer, int size);


/**
 * Set the current working directory.
 * \param   path   The new working directory.
 * \returns OKAY if successful.
 */
int platform_dir_set_current(const char* path);


#endif