Skip to content

Fix several examples v2 #439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ GUI := $(subst .bas,,$(wildcard GUI/*/*.bas GUI/*/*/*.bas))
MANUAL := $(subst .bas,,$(wildcard manual/*.bas manual/*/*.bas))
MATH := $(subst .bas,,$(wildcard math/*.bas math/*/*.bas))
MISC := $(subst .bas,,$(wildcard misc/*/*.bas))
NETWORK := $(subst .bas,,$(wildcard network/*.bas network/*/*.bas \
network/*/*/*.bas))
NETWORK := $(subst .bas,,$(wildcard network/*.bas network/*/*.bas)) \
network/curl/CHttp/libCHttp.a network/curl/CHttp/test
#OPTIMIZE := $(subst .bas,,$(wildcard OptimizePureAbstractTypes/*.bas))
#REGEX := $(subst .bas,,$(wildcard regex/*/*.bas))
SOUND := $(subst .bas,,$(wildcard sound/*/*.bas))
Expand Down Expand Up @@ -107,6 +107,13 @@ DOS/%: DOS/%.bas
endif
endif

network/curl/CHttp/libCHttp.a: network/curl/CHttp/CHttp.bas \
network/curl/CHttp/CHttpForm.bas network/curl/CHttp/CHttpStream.bas
$(FBC) -lib $^

network/curl/CHttp/test: network/curl/CHttp/libCHttp.a
$(FBC) -p $(dir $@) [email protected] $<

threads/timer-lib/libtimer$(DLLEXT): threads/timer-lib/timer.bas
$(FBC) -dylib -mt $<

Expand Down
3 changes: 2 additions & 1 deletion examples/graphics/Allegro5/hello.bas
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

var TTF_FONT = exepath() + "/../SDL/data/Vera.ttf"

al_init()
'' al_init() '' defined with v5.0.11, initialise with current version instead
al_install_system(al_get_allegro_version(), @atexit)
al_init_font_addon()
al_init_ttf_addon()

Expand Down
2 changes: 1 addition & 1 deletion examples/graphics/cairo/cairo_elipsis.bas
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ VAR S_W = CUINT(Pag_W) + 1, S_H = CUINT(Pag_H) + 1
SCREENRES S_W, S_H, 32
VAR c_s_t = cairo_image_surface_create_for_data( _
SCREENPTR, CAIRO_FORMAT_ARGB32, _
S_W, S_H, S_W * LEN(INTEGER))
S_W, S_H, cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, S_W))
VAR wi = 0.0
DO
SCREENLOCK
Expand Down
2 changes: 1 addition & 1 deletion examples/graphics/cairo/cairo_output.bas
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ SUB write_screen()
SCREENRES S_W, S_H, 32
VAR c_s_t = cairo_image_surface_create_for_data( _
SCREENPTR, CAIRO_FORMAT_ARGB32, _
S_W, S_H, S_W * LEN(INTEGER))
S_W, S_H, cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, S_W))
SCREENLOCK
DoDrawing(c_s_t)
SCREENUNLOCK
Expand Down
2 changes: 1 addition & 1 deletion examples/graphics/cairo/clock.bas
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ScreenRes SCREEN_W, SCREEN_H, 32
Dim As cairo_surface_t Ptr surface = _
cairo_image_surface_create_for_data(ScreenPtr(), _
CAIRO_FORMAT_ARGB32, SCREEN_W, SCREEN_H, _
SCREEN_W * SizeOf(Integer))
cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, SCREEN_W))

Dim As cairo_t Ptr c = cairo_create(surface)
cairo_scale(c, SCREEN_W, SCREEN_H)
Expand Down
3 changes: 1 addition & 2 deletions examples/network/curl/CHttp/CHttp.bi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#define FALSE 0
#endif

#inclib "CHttp"
#inclib "curl"

type CHttp as CHttp_
Expand Down Expand Up @@ -44,4 +43,4 @@ private:
dim as CHttpCtx ptr ctx = any
end type

#endif
#endif
5 changes: 3 additions & 2 deletions examples/network/http-get.bas
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
#ifdef __FB_WIN32__
#include once "win/winsock2.bi"
#else
#include once "crt/arpa/inet.bi"
#include once "crt/netdb.bi"
#include once "crt/sys/socket.bi"
#include once "crt/netinet/in.bi"
#include once "crt/arpa/inet.bi"
#include once "crt/stdio.bi"
#include once "crt/sys/socket.bi"
#include once "crt/unistd.bi"
#endif

Expand Down