003 File Manager
Current Path:
/usr/src/contrib/netbsd-tests/lib/csu
usr
/
src
/
contrib
/
netbsd-tests
/
lib
/
csu
/
📁
..
📁
arch
📁
dso
📄
h_initfini1.cxx
(142 B)
📄
h_initfini3.cxx
(513 B)
📄
h_initfini_common.cxx
(761 B)
📄
t_crt0.sh
(2.76 KB)
Editing: h_initfini_common.cxx
#include <unistd.h> #ifdef CHECK_STACK_ALIGNMENT #include <stdlib.h> extern "C" int check_stack_alignment(void); #endif class Test { public: Test() { static const char msg[] = "constructor executed\n"; write(STDOUT_FILENO, msg, sizeof(msg) - 1); #ifdef CHECK_STACK_ALIGNMENT if (!check_stack_alignment()) { static const char msg2[] = "stack unaligned \n"; write(STDOUT_FILENO, msg2, sizeof(msg2) - 1); exit(1); } #endif } ~Test() { static const char msg[] = "destructor executed\n"; write(STDOUT_FILENO, msg, sizeof(msg) - 1); #ifdef CHECK_STACK_ALIGNMENT if (!check_stack_alignment()) { static const char msg2[] = "stack unaligned \n"; write(STDOUT_FILENO, msg2, sizeof(msg2) - 1); exit(1); } #endif } }; Test test;
Upload File
Create Folder