removed stdio from print build info

This commit is contained in:
ignis 2019-05-22 18:31:07 +09:00
parent 33fb2a3279
commit eec864f2c7
4 changed files with 23 additions and 21 deletions

View file

@ -62,11 +62,11 @@ build_info.o : build_info.txt
ld -r -b binary -o build_info.o build_info.txt
build_info.txt : code_gen/terms.input
echo "build date:" > build_info.txt
echo "<<build date>>" > build_info.txt
date >> build_info.txt
echo "build base revision" >> build_info.txt
echo "<<build base revision>>" >> build_info.txt
git rev-parse HEAD >> build_info.txt
echo "git status" >> build_info.txt
echo "<<git status>>" >> build_info.txt
git status >> build_info.txt
echo "terms" >> build_info.txt
echo "<<terms>>" >> build_info.txt
cat code_gen/terms.input >> build_info.txt

View file

@ -7,7 +7,11 @@
USE post
USE Compact
CALL print_data
character (len=2000) :: input_string
call cstr(input_string)
write(*,*) input_string
CALL m_openmpi_init

View file

@ -1,25 +1,19 @@
#include <stdio.h>
extern const char _binary_build_info_txt_start [];
extern const char _binary_build_info_txt_end [];
extern const char _binary_build_info_txt_size [];
void print_data_ ()
void cstr_( char *s, unsigned long b )
{
char* p = &_binary_build_info_txt_start;
while ( p != &_binary_build_info_txt_end ) putchar(*p++);
}
/*
*/
void cstr_( char *s, int *b )
{ /* return n copies of arg */
int count = 0;
char* p = &_binary_build_info_txt_start;
while ( p != &_binary_build_info_txt_end )
while ( p != &_binary_build_info_txt_end && count < b )
{
s[count++] = *p++;
}
while ( count < b )
{
s[count++] = ' ';
}
}

View file

@ -18,7 +18,11 @@ real*4, dimension(2) :: startt
real*4, dimension(2) :: endt
real*4 :: result
call print_data
character (len=2000) :: input_string
call cstr(input_string)
write(*,*) input_string
nxp = 512
nyp = 256