Página 2 de 2

Teste XHarbour

Enviado: 12 Out 2017 18:35
por asimoes
Como diria o STF (rs) acompanho o voto do Itamar, data venia, o xHarbour é querer se meter em problemas

Teste XHarbour

Enviado: 12 Out 2017 19:42
por JoséQuintas
Pensei pelo lado positivo:
O maior problema das LIBs é criar aquelas tranqueiras de BAT e enviar Harbour junto.
Com o uso de HBMK2 simplifica para o XHarbour, e deixa as LIBs mais limpas, nem precisando mandar Harbour junto.

Mas pra fazer o teste, acabei vendo alguns sites, li algumas coisas, etc.
Acabei achando tudo suspeito, parece que a intenção é deixar o usuário preso, destinado a usar algo comercial.
Com certeza o xHarbour não está parado, o que está parado é a parte destinada a open-source.

Notícia interessante no Harbour Devel:
Andi Jahja asked me to provide a link to a HB 3.4 32-bit build under BCC
7.3 for the BCC users that he is in contact with.
This strictly binary download is available at whosaway.com.
Thanks to Andi for this very trimmed binary package.
Podem perguntar: se alguém fez o Harbour 3.4 pra BCC, porque não tem isso oficialmente?
Poderia ter... se a mesma pessoa tivesse enviado para ser parte dele, ao invés de fazer separado.

Isso também aumenta a suspeita que mencionei....
De repente saiu destinado ao uso junto com algum produto comercial.
Quanto mais fora do padrão, mais preso o usuário vai ficar ao produto.

Teste XHarbour

Enviado: 13 Out 2017 12:47
por JoséQuintas
Dá vontade de puxar a orelha dos usuários XHarbour e de quem cria LIB pra ele kkkkkkk

Sefazclass com Harbour
d:\cdrom\FONTES\INTEGRA\sefazclass>hbmk2 sefazclass -w3 -es2 -q0
hbmk2: Processando opções do ambiente: -comp=mingw
hbmk2: Processando arquivo de configuração: d:\harbour\bin\hbmk.hbc
Sefazclass com XHarbour
hbmk2 sefazclass -xhb -q0

hbmk2: Processing environment options: -comp=bcc
hbmk2 [sefazclass]: Warning: Cannot find hbhpdf.hbc (referenced from
sefazclass.hbc)
hbmk2 [sefazclass]: Warning: Cannot find hbzebra.hbc (referenced from
sefazclass.hbc)
hbmk2 [sefazclass]: Warning: Cannot find hbwin.hbc (referenced from
sefazclass.hbc)
hbmk2 [sefazclass]: Warning: Cannot find hbct.hbc (referenced from
sefazclass.hbc)
source\ze_SpedAssina.prg(59) Error E0030 Syntax error: "syntax error at 'WITH'"
source\ze_SpedAssina.prg(85) Error E0030 Syntax error: "syntax error at 'END'"
source\ze_SpedAssina.prg(98) Error E0025 Invalid RETURN from within of SEQUENCE code
source\ze_SpedAssina.prg(215) Error E0030 Syntax error: "syntax error at 'WITH'"
source\ze_SpedAssina.prg(224) Error E0030 Syntax error: "syntax error at 'END'"
source\ze_SpedAssina.prg(228) Error E0025 Invalid RETURN from within of SEQUENCE code
source\ze_SpedAssina.prg(233) Error E0030 Syntax error: "syntax error at 'WITH'"
source\ze_SpedAssina.prg(239) Error E0030 Syntax error: "syntax error at 'END'"
source\ze_SpedAssina.prg(248) Error E0025 Invalid RETURN from within of SEQUENCE code
source\ze_SpedAssina.prg(251) Error E0025 Invalid RETURN from within of SEQUENCE code
source\ze_SpedAssina.prg(254) Error E0025 Invalid RETURN from within of SEQUENCE code
source\ze_SpedAssina.prg(256) Warning W0032 Variable 'LOK' is assigned but not used in function 'ASSINALOADXML(213)'
source\ze_SpedAssina.prg(256) Warning W0032 Variable 'LOK' is assigned but not used in function 'ASSINALOADXML(231)'
source\ze_SpedAssina.prg(266) Error E0030 Syntax error: "syntax error at 'WITH'"
source\ze_SpedAssina.prg(273) Error E0030 Syntax error: "syntax error at 'END'"
source\ze_SpedAssina.prg(276) Error E0025 Invalid RETURN from within of SEQUENCE code
source\ze_SpedAssina.prg(279) Error E0025 Invalid RETURN from within of SEQUENCE code
source\ze_SpedAssina.prg(281) Warning W0032 Variable 'LOK' is assigned but not used in function 'ASSINALOADCERTIFICADO(258)'
hbmk2 [sefazclass]: Error: Running Harbour compiler. 1
d:\xharbour\bin\harbour.exe -n1 source\ze_SpedAssina.prg -w3 -es2 -m -n -DHBMK_HAS_SEFAZCLASS=1 -q0 -oC:\Users\joseq\AppData\Local\Temp\hbmk_rgdgap.dir\ -id:\xharbour\comp\bcc\Include -id:\xharbour\include -iinclude -undef:.ARCH. -D__PLATFORM__WINDOWS
Ok, diferença do BEGIN SEQUENCE WITH __BreakBlock()

Criei hb2xhb.ch
#translate BEGIN SEQUENCE WITH __BreakBlock() => BEGIN SEQUENCE
E no projeto da LIB (sefazclass.hbc) , acrescentei pra se for XHarbour, usar esse CH
{xhb}headers=hb2xhb.ch
nova compilação:
hbmk2 sefazclass -xhb -q0

hbmk2: Processing environment options: -comp=bcc
hbmk2 [sefazclass]: Warning: Cannot find hbhpdf.hbc (referenced from
sefazclass.hbc)
hbmk2 [sefazclass]: Warning: Cannot find hbzebra.hbc (referenced from
sefazclass.hbc)
hbmk2 [sefazclass]: Warning: Cannot find hbwin.hbc (referenced from
sefazclass.hbc)
hbmk2 [sefazclass]: Warning: Cannot find hbct.hbc (referenced from
sefazclass.hbc)
source\ze_spedAssinachk.prg(64) Warning W0032 Variable 'CXMLRETORNO' is assigned but not used in function 'CHKSIGNATURE(25)'
source\ze_spedAssinachk.prg(64) Warning W0032 Variable 'CXMLRETORNO' is assigned but not used in function 'CHKSIGNATURE(31)'
source\ze_spedAssinachk.prg(64) Warning W0032 Variable 'CXMLRETORNO' is assigned but not used in function 'CHKSIGNATURE(37)'
source\ze_spedAssinachk.prg(64) Warning W0032 Variable 'CXMLRETORNO' is assigned but not used in function 'CHKSIGNATURE(42)'
source\ze_spedAssinachk.prg(64) Warning W0032 Variable 'CXMLRETORNO' is assigned but not used in function 'CHKSIGNATURE(45)'
source\ze_spedAssinachk.prg(64) Warning W0032 Variable 'CXMLRETORNO' is assigned but not used in function 'CHKSIGNATURE(48)'
hbmk2 [sefazclass]: Error: Running Harbour compiler. 1
d:\xharbour\bin\harbour.exe -n1 source\ze_spedAssinachk.prg -w3 -es2 -m -n -DHBMK_HAS_SEFAZCLASS=1 -q0 -oC:\Users\joseq\AppData\Local\Temp\hbmk_9hjj4d.dir\ -id:\xharbour\comp\bcc\Include -id:\xharbour\include -iinclude -u+hb2xhb.ch -undef:.ARCH. -D__PLATFORM__WINDOWS
É até interessante: a "tolerância zero" do xHarbour foi mais exigente.
O que não explica porque os fontes das LIBs são tão ruins, já que isso também existe no xHarbour.... rs

O erro que acusou dá pra entender:
BEGIN SEQUENCE WITH __BreakBlock()

cRetorno := "Erro Assinatura: Não carregado MSXML2.MXDigitalSignature.5.0"
xmldsig := Win_OleCreateObject( "MSXML2.MXDigitalSignature.5.0" )

cRetorno := "Erro Assinatura: Template de assinatura não encontrado"
xmldsig:signature := oDOMDocument:selectSingleNode(".//ds:Signature")

cRetorno := "Erro assinatura: Certificado pra assinar XmlDSig:Store"
xmldsig:store := oCapicomStore
À primeira vista, trocar o conteúdo de cRetorno não serve pra nada.
Mas na prática serve: é que conforme aonde acontecer o erro, a mensagem vai ser diferente.
É aceitável.
Então vamos sem "tolerância zero"
hbmk2 sefazclass -xhb -q0 -w0 -es0

hbmk2: Processing environment options: -comp=bcc
hbmk2 [sefazclass]: Warning: Cannot find hbhpdf.hbc (referenced from
sefazclass.hbc)
hbmk2 [sefazclass]: Warning: Cannot find hbzebra.hbc (referenced from
sefazclass.hbc)
hbmk2 [sefazclass]: Warning: Cannot find hbwin.hbc (referenced from
sefazclass.hbc)
hbmk2 [sefazclass]: Warning: Cannot find hbct.hbc (referenced from
sefazclass.hbc)
source\ze_SpedDaCte.prg(9) Error F0029 Can't open #include file: 'harupdf.ch'
hbmk2 [sefazclass]: Error: Running Harbour compiler. 1
d:\xharbour\bin\harbour.exe -n1 source\ze_SpedDaCte.prg -w3 -es2 -m -n -DHBMK_HAS_SEFAZCLASS=1 -q0 -w0 -es0 -oC:\Users\joseq\AppData\Local\Temp\hbmk_bjmpdb.dir\ -id:\xharbour\comp\bcc\Include -id:\xharbour\include -iinclude -u+hb2xhb.ch -undef:.ARCH. -D__PLATFORM__WINDOWS
Ok. Deu falta da LIB harupdf, pra gerar pdf, e seus #defines.

Num primeiro momento, resolvi a diferença dos fontes entre Harbour/XHarbour apenas adicionando um arquivo CH.

Foi só teste.
O lugar correto seria no sefazclass.HBP e não no sefazclassHBC.
Porque? porque sefazclass.HBP é particular da LIB SefazClass, e sefazclass.HBC vai atender qualquer projeto que use a Sefazclass.
E não queremos que isso interfira em outras compilações, somente na Sefazclass.

{xhb} essa indicação já se encarrega de somente acrescentar isso se for compilação pra xHarbour.

A compilação -w3 -es2 também existe no xHarbour.
Porque não usam pelo menos nos fontes das LIBs.... não faço idéia.

Minha conclusão:

Vira tudo igual, só altera o -xhb
É um começo pra padronizar tudo cada vez mais, e ser melhor pra todos.
Quem sabe o que pode vir depois....

Nota:
Não é o uso do HBMK2 que vai "roubar" usuários do XHarbour, não sei se essa é a preocupação do XHarbour.
Vai ver os produtos comerciais pra XHarbour tem isso embutido, afinal, não sabemos o que tem nos fontes.... rs

Ah sim... tenho que ser justo:
precisei alterar um arquivo CH do XHarbour, o hbsetup.ch:
#ifndef HB_COMPAT_C53
#define HB_COMPAT_C53 /* Enable CA-Cl*pper 5.3x extensions */
#endif
coloquei esse #ifndef, porque acusou duplicidade de declaração.
com isso, só vai definir se não estiver definido ainda.
Não altera nada na compilação, continua tudo igual, apenas evita o erro de declarar em dobro.

Teste XHarbour

Enviado: 13 Out 2017 23:06
por JoséQuintas
Um teste maior: OOHG

Funcionando com HBMK2, seja Harbour, XHarbour, BCC, MINGW, seja o que for.

Já repassei ao Fernando Yurisich (OOHG) pra ver o que ele diz.