Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Prog2
/
labor_peldak
/
lab_04
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7168a018
authored
Feb 27, 2019
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unix
parent
00cbfa1d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
Makefile
+4
-3
console.cpp
+2
-2
console.h
+5
-4
No files found.
Makefile
View file @
7168a018
# Pelda Makefile a Cpp Ellenallas megoldasanak forditasara
# Pelda Makefile a Cpp Ellenallas
(3. laborfeledati)
megoldasanak forditasara
# Solaris (ural2) es Linux ala.
objs1
=
resistor.o resistor_test.o
# forditando obj. fajlok
...
...
@@ -6,11 +6,11 @@ heads1 = resistor.h # # headerek, amitol minden fugg
prog1
=
resistor_test
# # a program neve
objs2
=
resistor.o resistor_test2.o
heads2
=
resistor.h
heads2
=
resistor.h
elkeszult.h
prog2
=
resistor_test2
objs3
=
resistor.o potmeter.o console.o potmeter_teszt.o
heads3
=
resistor.h
potmeter.h console.h
heads3
=
resistor.h
elkeszult.h potmeter.h console.h
prog3
=
potmeter_teszt
targets
=
$(prog1)
$(prog2)
$(prog3)
...
...
@@ -20,6 +20,7 @@ CXX = g++ # # a C++ fordito neve
CXXFLAGS
=
-pedantic
-Wall
# # C++ kapcsolok: legyen bobeszedu,
CXXFLAGS
+=
-g
# # ... es legyen debug info is
CXXFLAGS
+=
-fno-elide-constructors
# ne optimalizálja másoló konstruktorok hívását
CXXFLAGS
+=
$(CMD)
# CMD a parancssorból
(
pl:
CMD
=
-DDEBUG
)
# alapertelmezett cel: erdeklodik, hogy melyik legyen
...
...
console.cpp
View file @
7168a018
...
...
@@ -91,7 +91,7 @@ inline int Console::trCode(int code, keyCodes* kt) {
/// UNIX/Linux alatt át ki kell kapcsolni az echo-t és a kanonikus módot
Console
::
Console
()
{
#if
_UNIX
#if
defined(_UNIX)
struct
termios
newt
;
tcgetattr
(
STDIN_FILENO
,
&::
term_save
);
newt
=
term_save
;
...
...
@@ -102,7 +102,7 @@ Console::Console() {
/// Elmentett működési módok visszaállítása
Console
::~
Console
()
{
#if
_UNIX
#if
defined(_UNIX)
tcsetattr
(
STDIN_FILENO
,
TCSANOW
,
&::
term_save
);
#endif
}
...
...
console.h
View file @
7168a018
...
...
@@ -6,10 +6,11 @@
#ifndef CONSOLE_H
#define CONSOLE_H
#define _WINX defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
#define _UNIX defined(__linux__) || defined(__sun)
#if !defined(_WINX) && !defined(_UNIX)
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
# define _WINX
#elif defined(__linux__) || defined(__sun)
# define _UNIX
#else
# error "OS?"
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment