Version used in user agent used well defined version.

Moved project definitions from premake.c to premake.h and added PREMAKE_ prefixes.
Utilized PREMAKE_VERSION in the user agent when making curl requests.
This commit is contained in:
Mathew Versluys 2016-05-14 11:01:37 -07:00
parent 8a03bbb065
commit a51a4cfd6b
3 changed files with 8 additions and 7 deletions

View File

@ -157,7 +157,7 @@ static CURL* curl_request(lua_State* L, CurlCallbackState* state, FILE* fp, int
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, state->errorBuffer);
curl_easy_setopt(curl, CURLOPT_USERAGENT, "premake/5.0");
curl_easy_setopt(curl, CURLOPT_USERAGENT, "Premake/" PREMAKE_VERSION);
if (lua_type(L, userpwdIndex) == LUA_TSTRING) {
curl_easy_setopt(curl, CURLOPT_USERPWD, luaL_checkstring(L, userpwdIndex));

View File

@ -14,9 +14,6 @@
#endif
#define VERSION "5.0.0-dev"
#define COPYRIGHT "Copyright (C) 2002-2016 Jason Perkins and the Premake Project"
#define PROJECT_URL "https://github.com/premake/premake-core/wiki"
#define ERROR_MESSAGE "Error: %s\n"
@ -138,13 +135,13 @@ int premake_init(lua_State* L)
lua_pushstring(L, LUA_COPYRIGHT);
lua_setglobal(L, "_COPYRIGHT");
lua_pushstring(L, VERSION);
lua_pushstring(L, PREMAKE_VERSION);
lua_setglobal(L, "_PREMAKE_VERSION");
lua_pushstring(L, COPYRIGHT);
lua_pushstring(L, PREMAKE_COPYRIGHT);
lua_setglobal(L, "_PREMAKE_COPYRIGHT");
lua_pushstring(L, PROJECT_URL);
lua_pushstring(L, PREMAKE_PROJECT_URL);
lua_setglobal(L, "_PREMAKE_URL");
/* set the OS platform variable */

View File

@ -9,6 +9,10 @@
#include "lauxlib.h"
#include "lualib.h"
#define PREMAKE_VERSION "5.0.0-dev"
#define PREMAKE_COPYRIGHT "Copyright (C) 2002-2016 Jason Perkins and the Premake Project"
#define PREMAKE_PROJECT_URL "https://github.com/premake/premake-core/wiki"
/* Identify the current platform 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__)