use version from swi

This commit is contained in:
Vítor Santos Costa 2013-01-21 09:36:50 +00:00
parent 0e89a9c2ff
commit b9f1885f0a
4 changed files with 46 additions and 6 deletions

View File

@ -43,6 +43,9 @@
#include "Yap.h" #include "Yap.h"
#include "YapHeap.h" #include "YapHeap.h"
#define PLVERSION YAP_VERSION
#define PLNAME "yap"
/* try not to pollute the SWI space */ /* try not to pollute the SWI space */
#ifdef P #ifdef P
#undef P #undef P
@ -893,6 +896,10 @@ COMMON(char) digitName(int n, int sm);
/**** stuff from pl-utf8.c ****/ /**** stuff from pl-utf8.c ****/
size_t utf8_strlen(const char *s, size_t len); size_t utf8_strlen(const char *s, size_t len);
/**** stuff from pl-version.c ****/
COMMON(void) setGITVersion(void);
/**** stuff from pl-write.c ****/ /**** stuff from pl-write.c ****/
COMMON(char *) varName(term_t var, char *buf); COMMON(char *) varName(term_t var, char *buf);
COMMON(int) writeUCSAtom(IOSTREAM *fd, atom_t atom, int flags); COMMON(int) writeUCSAtom(IOSTREAM *fd, atom_t atom, int flags);

View File

@ -95,6 +95,8 @@ COMMON(bool) ChDir(const char *path);
COMMON(int) DeleteTemporaryFile(atom_t name); COMMON(int) DeleteTemporaryFile(atom_t name);
COMMON(int) IsAbsolutePath(const char *spec); COMMON(int) IsAbsolutePath(const char *spec);
COMMON(bool) sysError(const char *fm, ...);
/* TBD */ /* TBD */
extern word globalString(size_t size, char *s); extern word globalString(size_t size, char *s);

View File

@ -75,9 +75,7 @@ too much.
static void setArgvPrologFlag(void); static void setArgvPrologFlag(void);
#endif #endif
static void setTZPrologFlag(void); static void setTZPrologFlag(void);
#ifndef __YAP_PROLOG__
static void setVersionPrologFlag(void); static void setVersionPrologFlag(void);
#endif
static atom_t lookupAtomFlag(atom_t key); static atom_t lookupAtomFlag(atom_t key);
static void initPrologFlagTable(void); static void initPrologFlagTable(void);
@ -1204,8 +1202,8 @@ initPrologFlags(void)
setTZPrologFlag(); setTZPrologFlag();
#ifndef __YAP_PROLOG__ #ifndef __YAP_PROLOG__
setOSPrologFlags(); setOSPrologFlags();
setVersionPrologFlag();
#endif /* YAP_PROLOG */ #endif /* YAP_PROLOG */
setVersionPrologFlag();
} }
@ -1241,8 +1239,6 @@ setTZPrologFlag(void)
setPrologFlag("timezone", FT_INTEGER|FF_READONLY, timezone); setPrologFlag("timezone", FT_INTEGER|FF_READONLY, timezone);
} }
#ifndef __YAP_PROLOG__
static void static void
setVersionPrologFlag(void) setVersionPrologFlag(void)
{ GET_LD { GET_LD
@ -1265,7 +1261,6 @@ setVersionPrologFlag(void)
setGITVersion(); setGITVersion();
} }
#endif /* YAP_PROLOG */
void void
cleanupPrologFlags(void) cleanupPrologFlags(void)

36
os/pl-version.c Normal file
View File

@ -0,0 +1,36 @@
/* $Id$
Part of SWI-Prolog
Author: Jan Wielemaker
E-mail: wielemak@science.uva.nl
WWW: http://www.swi-prolog.org
Copyright (C): 1985-2007, University of Amsterdam
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "pl-incl.h"
#ifdef USE_GIT_VERSION_H
#include <version.h>
#endif
void
setGITVersion(void)
{
#ifdef GIT_VERSION
PL_set_prolog_flag("version_git", PL_ATOM|FF_READONLY, GIT_VERSION);
#endif
}